On Sunday, August 2, 2020 at 12:19:21 AM UTC-7, Birthe C wrote: > > I am from Denmark. Copenhagen is GMT+1, but right now we have summertime > GMT+2. I guess summertime also will represent problems around the globe. >
Yes... "Summertime" (aka Daylight Saving Time) is highly problematic for these calculations. TiddlyWiki uses UTC (Universal Time Coordinated) as the basis for its system time values (e.g., the tiddler's created and modified timestamps). See https://www.timeanddate.com/time/aboututc.html. Unlike GMT (Greenwich Mean Time), UTC is not a time zone, and doesn't change during the summer months. Right now, in California (where I am) we are currently using PDT (Pacific Daylight Time), which has an offset of -07:00 from UTC. In Autumn, we will switch back to PST (Pacific Standard Time), which has an offset of -08:00 from UTC. Similarly, right now, in Denmark, you are currently using CEST (Central European Summer Time), which has an offset of +02:00 from UTC. In Autumn, you will switch back to CET (Central European Time), which has an offset of +01:00 from UTC. My timer.html code doesn't account for "Summer Time" in any way. It simply accepts an optional "offset" parameter which is currently hard-coded into the SampleWorldClocks tiddler, like this: <<showClock "local time" >> <<showClock "Honolulu" -1000>> <<showClock "Los Angeles" -0700>><br> <<showClock "New York" -0400>> <<showClock "London" +0100>> <<showClock "Rome" +0200>><br> <<showClock "Moscow" +0300>> <<showClock "Tokyo" +0900>> <<showClock "Sydney" +1000>><br> As currently written, the offsets are based on Summer Time values, which will be changing in the Autumn; e.g., while Los Angeles is currently -0700, it will be -08:00 later this year. Complicating this is the fact that the dates on which the change to/from Daylight Saving Time (Summer Time) occurs is varies for different locations. The US change occurs several weeks before/after Britain and Europe, so the time difference between those places actually varies (e.g., most of the time, California is 8 hours behind Britain, but for a few weeks in Spring and Autumn, we are just 7 hours behind). Further complicating this is the fact that some places *do not switch at all*; e.g., Hawaii (Honolulu) is always -1000 from UTC because it is closer to the Equator and gets enough daylight all the time that it has no need to shift timezones seasonally. There's also exceptions in some places that are mostly for political reasons; e.g., Arizona hasn't observed Daylight Saving Time for about the last 40 years, except for the Navajo Nation area, which does! One exception in my SampleWorldClocks offsets is the "local time" clock. It uses "<<now TZD>>" to get the current offset value directly from the system, rather than using a hard-coded offset value. Thus, it will automatically change from Daylight Saving Time to Standard Time when the system clock changes in the Autumn. At some point in the future, I will probably add the ability to select the time zone for a given location, so that manually editing the tiddler to change the hard-coded offsets won't be needed. But you will still have to know which time zone a location is currently using, as the rules for where and when the switch between Daylight Saving Time and Standard Time occurs are just too complicated to calculate without a lot of effort. ... has your head exploded yet? I think there's some blood dripping from my ears just from writing the above description of the problem! -e -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/bcd82cb6-fbed-4596-ad8a-169128db5156o%40googlegroups.com.

