On Saturday, August 1, 2020 at 5:59:51 PM UTC-7, Eric Shulman wrote:
>
> Unfortunately, I've just found a nasty logic error in my handling for 
> timezone.  It doesn't work right when calculating across date boundaries.  
> For example, my time zone is UTC-7 (Pacific Time), and I was converting 
> from GMT to local time by simply subtracting the number of hours.  But... 
> when its just after 5pm here the hour is 17, but in GMT, it's just after 
> midnight *the next day* and the hours there is 00, so simply subtracting 
> the timezone offset give hour 93 (00 - 07)!!!
>
> I'll let you know when I have a *working* update!
>

FIXED!  update http://TiddlyTools.com/timer.html

The AnalogClock and DigitalClock now support optionally specifying the 
timezone offset.

see http://tiddlytools.com/timer.html#SampleWorldClocks

Tony: check out the "adjustForTimezone()" code in 
TiddlyTools/Timer/DigitalClock (same code is also used in 
TiddlyTools/Timer/AnalogClock)

The math was tricky... and it still has two issues to deal with:
1) It needs to handle MONTH date adjustments (i.e., when it's the evening 
of 8/31 somewhere, it will be 9/01 somewhere else)
2) It needs to handle MINUTE timezone offset (there's a few timezones that 
aren't on the even hours.... especially in Australia!)

I also plan to build in a multi-select list of places, so you can choose 
which locations to show clocks for...

enjoy,
-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/91408c3d-ca5a-4334-a54a-b03f81f95d1fo%40googlegroups.com.

Reply via email to