[Gambas-user] Format function changes date value

Jussi Lahtinen jussi.lahtinen at gmail.com
Thu Jun 7 23:29:46 CEST 2018


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

On Fri, Jun 8, 2018 at 12:13 AM, Gianluigi <bagonergi at gmail.com> wrote:

>
>
> 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 ]----
>>
>>
>
>
> ----[ 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/20180608/7c23b774/attachment.html>


More information about the User mailing list