Dealing with time zones is always challenging. As a rule of thumb, it’s much easier if all date/time values are stored in the UTC format, and, if necessary, dealing with time zone conversations in the UI only.
This article is going to demonstrate how you can accomplish this task with JDBC and the awesome
hibernate.jdbc.time_zone configuration property.
Continue reading “How to store date, time, and timestamps in UTC time zone with JDBC and Hibernate”
Basic time notions
Relative numerical timestamp
The relative numerical timestamp is expressed as the number of milliseconds elapsed since epoch.
The coordinated universal time (UTC) is the most common time standard. The UTC time zone (equivalent to GMT) represents the time reference all other time zones relate to (through a positive/negative offset).
UTC time zone is commonly refereed as Zulu time (Z) or UTC+0. Japan time zone is UTC+9 and Honolulu time zone is UTC-10. At the time of Unix epoch (1 January 1970 00:00 UTC time zone) it was 1 January 1970 09:00 in Tokyo and 31 December 1969 14:00 in Honolulu.
ISO 8601 is the most widespread date/time representation standard and it uses the following date/time formats:
|UTC Zulu time
Continue reading “A beginner’s guide to Java time zone handling”