[Gambas-user] Format function changes date value
Gianluigi
bagonergi at gmail.com
Thu Jun 7 23:13:01 CEST 2018
2018-06-07 22:55 GMT+02:00 Jussi Lahtinen <jussi.lahtinen at gmail.com>:
>
> This is wrong: you are using Year(), Month(), Day()... functions that
>> assume a local date. It works only if the date is read in the same timezone
>> as the write.
>>
>
> The point is my way always assumes local date. Thus when "time zone"
> changes twice in a year, the dates and times keep the same, instead of
> being adjusted wrongly by hour.
>
>
> You have to, and just have to use CStr() and CDate(). I.e. write dates in
>> UTC, and read them back in UTC.
>>
>
> The problem is I'm not in UTC and my local time zone changes twice a year.
>
>
> Jussi
>
>
>
Hello Benoit, ML, Jussi, dear brothers in Gambas :-)
Thank you very much for the benevolent attention you dedicate to me.
It seems that on the dates, among the disciples of Benoit, constant
confusion reigns.
I think we can summarize that the best thing to do is to create time
calculations in UTC and then localize with Format what is shown to the user.
This should also work for Jussi's calculations, or not?
Regards
Gianluigi
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180607/ca6bf152/attachment.html>
More information about the User
mailing list