Joel Denke
12/17/2024, 7:10 PMDaniel Pitts
12/17/2024, 10:07 PMCLOVIS
12/18/2024, 8:28 AMJoel Denke
12/18/2024, 9:31 AMCLOVIS
12/18/2024, 9:36 AMParse regular utc datetime stringsThis is the definition of
Instant
avoid expose Instant to formatter layerWhy? Your data is an
Instant
Joel Denke
12/18/2024, 9:45 AMJoel Denke
12/18/2024, 9:46 AMCLOVIS
12/18/2024, 9:50 AMInstant
isn't a format, Instant
is a representation of "an actual point in time". All other types represent something else.
If you want to format per locale, you'd first convert your Instant
to a local time by combining it with the timezone ID (yourInstant.toLocalDateTime(tz)
) and then format thatJoel Denke
12/18/2024, 10:50 AMJoel Denke
12/18/2024, 10:52 AMCLOVIS
12/18/2024, 11:02 AMLocalDateTime
is "the time a clock shows". Instant
is "a physical instant in the universal timeline". Instant
is traditionally written and read in UTC, but that's completely arbitrary.
If your server is sending you "something that happened at a given time", then it's an Instant
, that's all there is to it.Joel Denke
12/18/2024, 11:04 AMCLOVIS
12/18/2024, 11:09 AMZonedDateTime
? Everything you said here you can do with Instant
without problems?Joel Denke
12/18/2024, 11:11 AMJoel Denke
12/18/2024, 11:12 AMCLOVIS
12/18/2024, 11:14 AMJoel Denke
12/18/2024, 11:16 AMJoel Denke
12/18/2024, 11:18 AMCLOVIS
12/18/2024, 12:02 PMJoel Denke
12/18/2024, 12:03 PMCLOVIS
12/18/2024, 1:12 PMJoel Denke
12/18/2024, 4:30 PM