Content
It’s a time zone change on December 31st in shanghal. See this pace for details of 1927 11860 in Shanghai. Basically at midnight at the end of 1927, the clocks went back 5 minutes and 52 seconds. So "1927-12-31 23:54:08" actually happened twice, and it looks like Java is parsing it as the later possible instant for that local datetime – hence the Just another episode in the often weird and wonderful world of time zones. rebuilt with version 20132 01 1.98. The original question would no ionger demonstrate quite the same behaviour. In 2013a, the result would be 358 seconds, with a transition time of 23-54-03 instead of 23:54:08 I only noticed this because I’m collecting questions like this in Noda Time, in the form of unit tests… The test has now been changed, but it just goes to show – not even historical data is safe In TZDB 2014f, the time of the change has moved to 1900-12-31, and it’s now a mere 343 second change (so the time between t and t1 IS 344 seconds, it vou see what I mean). To answer a question around a transition at 1900… it looks like the Java time zone implementation treats all time zones as simply being in their standard time for any instant before the start of 1900 UTC: public class Test public static void main(String args) throws Exception Long for (String id : TimeZone getAvailableIDs) Time?one Zone TimeZone.getTimeZone (id); zone. getraworset zone.gecurtsetstart Sustem.out.println(id); The code above produces no output on my Windows machine. So any time zone which has any offset other than its standard one at the start of 1900 will count that as a transition. 1ZDB itself has some data going back earlier than that, and doesn’t rely on any idea of a "fixed standard time (which is what getawOffset assumes to be a valid concept) so other libraries need t introduce this artiticial transition edited Mar 27. 2023 at 19:45 9 54 72 newered lul 27. 2011 at 8:31 Jon Skeet 1.4m 873 49186 4 Our is it still accurate? Son Sees