[Gambas-user] Different quantities of seconds from UNIX date...
Jussi Lahtinen
jussi.lahtinen at gmail.com
Sun Apr 8 00:04:32 CEST 2018
It's not simple. How do I save and load consistently time & date as string
given by user?
If I use CDate and CStr, the problem occurs when the user gives time & date
before the "daylight saving" applies, because it will be hour off when
loaded after the "daylight saving" applies. IF the user is not in UTC time
zone. This is because UTC+1 <--> UTC yields different result than UTC+2
<--> UTC.
If I use Val and Str, the problem occurs when language is changed.
Jussi
On Sat, Apr 7, 2018 at 7:19 PM, Benoît Minisini <g4mba5 at gmail.com> wrote:
> Le 07/04/2018 à 15:45, Jussi Lahtinen a écrit :
>
>> I really think the time zone should be optional argument for these
>> functions. I have constant troubles to understand how and what time
>> functions should be used. Really really unintuitive.
>> In my GAlarm project, when I finally got everything working, I noticed
>> that the "daylight saving time" fucks up all the alarm times by hour. No
>> idea how to fix.
>>
>>
>> Jussi
>>
>>
> It's simple: non localized date functions interpret string dates as UTC
> (CDate, CStr), whereas localized date functions (Val, Str, Format, Date)
> interpret string dates as being in local timezone.
>
> Internally dates are absolute, and stored in UTC.
>
> Regards,
>
> --
> Benoît Minisini
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List:
> https://lists.gambas-basic.org/listinfo/user
>
> Search the list:
> https://lists.gambas-basic.org/cgi-bin/search.cgi
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180408/902f2ac7/attachment.html>
More information about the User
mailing list