[Gambas-user] Format function changes date value

Benoît Minisini g4mba5 at gmail.com
Fri Jun 8 00:10:06 CEST 2018


Le 07/06/2018 à 23:29, Jussi Lahtinen a écrit :
> Unfortunately no. I can't use any conversions between UTC and local time 
> zone. See GAlarm from software farm.
> If I want to set alarm to remind me of meeting at 12:00 and if that 
> happens to be at date after time zone change, then the alarm is not 
> shown at 12:00 in local time, but instead something complicated (11:00 
> or 13:00 depending on the change [+/-1 UTC]).
> 
> So, my only solution is to always assume local time.
> 
> 
> Jussi
> 

OK, I forgot your alarm program.

Your case is special, because the date/time of an alarm is not absolute, 
but relative to the timezone of the user, and relative to the alarm day 
too, as the timezone may change during the year (thanks to the delirium 
of summer and winter time). The timezone may change unexpectly too for 
political reason (for example, North Korea has just adopted the South 
Korea timezone as a reconcilation sign).

So the rule would be:

- When you deal with dates & times decided by the user, you should store 
them in the local timezone of the user, or, better, add the timezone to 
the date string representation.

- When you deal with dates & times managed by the computer, usually from 
the past (for example a creation date, or a modification date), use UTC 
dates.

Regards,

-- 
Benoît Minisini


More information about the User mailing list