[Gambas-user] Best way converting dates into strings forth and back

Benoît Minisini g4mba5 at gmail.com
Fri Dec 10 20:24:21 CET 2021


Le 10/12/2021 à 20:14, Jussi Lahtinen a écrit :
> 
>     You are confusing strings with dates.
> 
> 
> No, it applies to the situation in every possible format (string, 
> integers, etc), if the timezone information is not included, but assumed.
> 
>     Rolf-Werner wanted to store a date using a string. So we don't care if
>     the timezone when reading is not the same as the timezone when writing.
> 
>     It will still be the same date.
> 
> 
> No, it depends completely on the local timezone. 12:00 UTC is assumed to 
> be 14:00 in one zone and 23:00 in another, etc, when in fact you stored 
> 13:00.
> I know it is confusing, but I have struggled with this issue for a very 
> long time without getting any decent solution for it.
> 
> There are two cases here.
> 1. The program is not running when the timezone changes.
> 2. The program is running when the timezone changes.
> 
> These cases create different bugs.
> 
> 
> Jussi
> 

Again, you are confusing date/time (which are absolute) with their 
string representation (which are not).

Please read the link on the wiki page I provide, I wrote some 
explanations about that confusion in it.

-- 
Benoît Minisini


More information about the User mailing list