4 ms·
I find that storing ZonedDateTime in your database as a UTC epochTime (long or int datatype depending on precision required) handles the use case where you nee
by nateh90 6y ago
I find that storing ZonedDateTime in your database as a UTC epochTime (long or int datatype depending on precision required) handles the use case where you need to store a precise moment in time, and is guaranteed to work across DB implementations.
- kuschku 6y agoAlternatively you can use TIMESTAMP and TIMESTAMPTZ types in postgres for instant and ZonedDateTime, and serialize local date, local time, and localdatetime either to iso 8601 pr their underlying fields (millis after midnight and julian date)