[Gambas-user] Possible CDATE issue Latest version
Benoit Minisini
benoit.minisini at gambas-basic.org
Sat Nov 19 18:43:36 CET 2022
Le 19/11/2022 à 17:26, Brian G a écrit :
>
> ----- On Nov 19, 2022, at 2:43 AM, Benoit Minisini benoit.minisini at gambas-basic.org wrote:
>
>> Le 18/11/2022 à 20:36, Brian G a écrit :
>>> With the latest version of gambas, I am getting the strangest issue, I
>>> dont understand, not sure if its a bug
>>> cdate returns different values if called with a class public variable.
>>> Locks like possibly like in the last case
>>> its return the gmt time.
>>>
>>> Hello world 11/18/2022 11:30:56
>>> CDATE(now) 11/18/2022 11:30:56
>>> Eval("cdate(now)") 11/18/2022 11:30:56
>>> dim thedate as string = "CDate(now)"
>>> Try ddate = Eval(thedate) 11/18/2022 19:30:56.895
>>>
>>
>> The printed strings are normal. What did you expect?
>>
>> --
>> Benoît Minisini.
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
> I expect the times to all be the same, the last time printed is a different time zone
> although the same expression is being evaluated.
>
It can't be the same as in your script, 'ddate' is a string that
receives the result of evaluating an expression that returns a date.
Hence this date is converted to a string automatically with CDate() to
be put inside the 'ddate' variable, and so you get the UTC
representation of the date as returned by CDate().
Regards,
--
Benoît Minisini.
More information about the User
mailing list