Month firstMonthOfQuarter() example

Description

Month firstMonthOfQuarter() gets the month corresponding to the first month of this quarter.

Syntax

firstMonthOfQuarter has the following syntax.


public Month firstMonthOfQuarter()

Example

The following example shows how to use firstMonthOfQuarter.


import java.time.LocalDate;
import java.time.Month;
/*from ww  w.  j a  v  a2s. c o m*/
public class Main {
  public static void main(String[] args) {
    Month m = Month.from(LocalDate.now());
    
    System.out.println(m.firstMonthOfQuarter());

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset