ZonedDateTime

Methods
19
Fields
None

Getting one

ZonedDateTime.now()
ZonedDateTime.ofInstant(…)
Instant.now():atZone(…)

Methods

MethodReturnsDescription
getZone()ZoneIdThe zone.
toLocalDate()LocalDateThe local date there.
toLocalTime()LocalTimeThe local time there.
toLocalDateTime()LocalDateTimeThe local date and time there.
getYear()numberThe year there.
getMonthValue()numberThe month there, 1 to 12.
getDayOfMonth()numberThe day of the month there.
getDayOfYear()numberThe day of the year there.
getDayOfWeek()DayOfWeekThe day of the week there.
getHour()numberThe hour there.
getMinute()numberThe minute there.
getSecond()numberThe second there.
getNano()numberThe nano-of-second.
withZoneSameInstant(ZoneId)ZonedDateTimeThe same instant in zone.
format(DateTimeFormatter)stringformatter's text.
equals(any)booleanWhether other is the same instant in the same zone.
toString()string2007-12-03T10:15:30+01:00[Europe/Paris].
now()ZonedDateTime() -> ZonedDateTime: Now in the system zone.
now(ZoneId)ZonedDateTime
ofInstant(Instant, ZoneId)ZonedDateTimeinstant in zone.

Returned by

MethodReturnsDescription
Instant.atZoneZonedDateTimeThis instant in zone.
LocalDateTime.atZoneZonedDateTimeThis date and time in zone (a time a gap skips moves forward by the gap; an overlap takes the earlier offset).
ZonedDateTimeClass.nowZonedDateTime() -> ZonedDateTime: Now in the system zone.
ZonedDateTimeClass.ofInstantZonedDateTimeinstant in zone.

Method details

equals

equals: (ZonedDateTime, any) -> boolean

Whether other is the same instant in the same zone.