To control the date and time, you want all of your moments to use a simple, monotonous linear scale. Peopleβs calendars, time zones, daylight saving time, they make things more complicated and are best stored at the display level.
The overall scale is the encoding of moments in the form of a few seconds (or milliseconds) from a specific origin. In Java, you will use milliseconds from January 1, 1970 at 00:00:00 UTC (also called the "Epoch"); you also ignore the seconds of the jump, so conversions to any date and time on any calendar are purely algorithmic. This scale returns System.currentTimeMillis() . In the Unix world, you can use the number of seconds since Epoch, since it is that the Unix kernel is subject to return (via the time() system call).
Such linear scales make it easy to compare dates and calculate time intervals, while any calendar calculations make such calculations difficult.
So, my advice would be to move away from the Julian dates, but, of course, do not turn them into Gregorian dates. On the contrary, in fact.
source share