get Quarter - Java java.time

Java examples for java.time:Quarter

Description

get Quarter

Demo Code


//package com.java2s;
import java.time.*;
import java.time.temporal.IsoFields;
import java.time.temporal.Temporal;

public class Main {
    public static int getQuarter(Temporal temporal) {
        return YearMonth.from(temporal).get(IsoFields.QUARTER_OF_YEAR);
    }/* w ww . j a v  a 2s . c om*/
}

Related Tutorials