Differences Between ZonedDateTime and OffsetDateTime

서민정·2024년 5월 21일

ZonedDateTime

immutable representation of a date-time with a timzone in the ISO-8601 calendar system.
It holds state equivalent to three separate object.

OffsetDateTime + ZoneRegion

OffsetDateTime

same with zonedDateTime but it uses with an offset from UTC/Greenwich in the ISO-8601 calendar system.

LocalDateTime(날짜 + 시간) + ZoneOffset

Main Differences

ZonedDateTime에서는 DST(Daylight Saving Time)과 같은 써머 타임의 정보가 들어가있음.
OffsetDateTime으로는 위치를 조절할 수가 없다. (=ZonedDateTime을 쓰면 ZoneId를 지정해서 넣어줄 수 있음)

profile
Server Engineer

0개의 댓글