Date/Time with TimeZone
-
Use UTC format for exchange of time-related data across time zones.
-
Time zones in
ISO 8601
are represented as local time (with the location unspecified), as UTC, or as an offset from UTC. -
Resources
Java
-
JSR-310 Date and Time API
-
Types
-
java.time.Instant
Best way to represent a point in time in UTC
-
java.time.LocalDateTime
Best way to represent a date and time without a time zone
-
java.time.ZonedDateTime
Best way to represent a date and time with a time zone
-
UTC
-
If the time is in
UTC
, add aZ
directly after the time without a space.Z
is the zone designator for the zeroUTC
offset.