[Gambas-user] Possible CDATE issue Latest version
brian at westwoodsvcs.com
Sat Nov 19 19:26:26 CET 2022
----- On Nov 19, 2022, at 9:43 AM, Benoit Minisini benoit.minisini at gambas-basic.org wrote:
> 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
>> 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().
> Benoît Minisini.
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
Maybe I am just a bit thick but I had expected
dim a as string = cdate(now)
To produce the same output value!
This is what is produced
if this is correct output, why it seems so very wrong!
and doing this
a = date(now)
produces as output
This also seems incorrect...
More information about the User