Calendars.
| Modifier and Type | Field and Description |
|---|---|
| private final Calendar | |
| public static final CalendarUtils | INSTANCE
The singleton instance for |
| private final Locale |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | CalendarUtils(final Calendar
A Calendar. calendar, final Locale A Locale. locale)Creates an instance for the given Calendar. |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | |
| public static CalendarUtils | Returns: a new instance.Creates a new instance based on the current time in the default time zone with the default |
| pack-priv static CalendarUtils | Returns: a Calendar.the locale for the week data locale)Gets a CalendarUtils using the default time zone and specified locale. |
| public int | |
| pack-priv String[] | Returns: Styled names of monthsMust be a valid style)Calendar#getDisplayNames(int, int, Locale) month style.Gets month names in the requested style. |
| pack-priv String[] | Returns: Long names of monthsGets full standalone month names as used in "LLLL" date formatting. |
| pack-priv String[] | Returns: Short names of monthsGets short standalone month names as used in "LLLL" date formatting. |
| public int | |
| public LocalDate | |
| public static LocalDateTime | Returns: a LocalDateTime.the Calendar to convert. calendar)Converts a Calendar to a LocalDateTime. |
| public LocalDateTime | |
| public static OffsetDateTime | Returns: a OffsetDateTime.the Calendar to convert. calendar)Converts a Calendar to a OffsetDateTime. |
| public OffsetDateTime | |
| public static ZonedDateTime | Returns: a ZonedDateTime.the Calendar to convert. calendar)Converts a Calendar to a ZonedDateTime. |
| public ZonedDateTime | |
| private static ZoneId |
| calendar | back to summary |
|---|---|
| private final Calendar calendar | |
| INSTANCE | back to summary |
|---|---|
| public static final CalendarUtils INSTANCE The singleton instance for
| |
| locale | back to summary |
|---|---|
| private final Locale locale | |
| CalendarUtils | back to summary |
|---|---|
| public CalendarUtils(final Calendar calendar) Creates an instance for the given Calendar.
| |
| CalendarUtils | back to summary |
|---|---|
| pack-priv CalendarUtils(final Calendar calendar, final Locale locale) Creates an instance for the given Calendar. | |
| getDayOfMonth | back to summary |
|---|---|
| public int getDayOfMonth() Gets the current day of month.
| |
| getDayOfYear | back to summary |
|---|---|
| public int getDayOfYear() Gets the current day of year.
| |
| getInstance | back to summary |
|---|---|
| public static CalendarUtils getInstance() Creates a new instance based on the current time in the default time zone with the default
| |
| getInstance | back to summary |
|---|---|
| pack-priv static CalendarUtils getInstance(final Locale locale) Gets a CalendarUtils using the default time zone and specified locale. The
| |
| getMonth | back to summary |
|---|---|
| public int getMonth() Gets the current month.
| |
| getMonthDisplayNames | back to summary |
|---|---|
| pack-priv String[] getMonthDisplayNames(final int style) Gets month names in the requested style.
| |
| getStandaloneLongMonthNames | back to summary |
|---|---|
| pack-priv String[] getStandaloneLongMonthNames() Gets full standalone month names as used in "LLLL" date formatting.
| |
| getStandaloneShortMonthNames | back to summary |
|---|---|
| pack-priv String[] getStandaloneShortMonthNames() Gets short standalone month names as used in "LLLL" date formatting.
| |
| getYear | back to summary |
|---|---|
| public int getYear() Gets the current year.
| |
| toLocalDate | back to summary |
|---|---|
| public LocalDate toLocalDate() Converts this instance to a
| |
| toLocalDateTime | back to summary |
|---|---|
| public static LocalDateTime toLocalDateTime(final Calendar calendar) Converts a Calendar to a LocalDateTime.
| |
| toLocalDateTime | back to summary |
|---|---|
| public LocalDateTime toLocalDateTime() Converts this instance to a
| |
| toOffsetDateTime | back to summary |
|---|---|
| public static OffsetDateTime toOffsetDateTime(final Calendar calendar) Converts a Calendar to a OffsetDateTime.
| |
| toOffsetDateTime | back to summary |
|---|---|
| public OffsetDateTime toOffsetDateTime() Converts this instance to a
| |
| toZonedDateTime | back to summary |
|---|---|
| public static ZonedDateTime toZonedDateTime(final Calendar calendar) Converts a Calendar to a ZonedDateTime.
| |
| toZonedDateTime | back to summary |
|---|---|
| public ZonedDateTime toZonedDateTime() Converts this instance to a
| |
| toZoneId | back to summary |
|---|---|
| private static ZoneId toZoneId(final Calendar calendar) | |