[Gambas-user] CDate Documentation

Jussi Lahtinen jussi.lahtinen at gmail.com
Tue Nov 15 03:06:24 CET 2022

> If you want the timezone in use, just use 'Val()' then. Leave 'CDate()'
>> alone. I don't see why it is a problem.
> Yes, I don't use CDate at all, but still the problem occurs when switching
> from summer time to winter time.

Let's say I have a date variable, which contains my chosen date "something
12:00", which internally (IE in UTC) is "something 10:00" (in reality of
course as float).
Now suddenly "timezone changes" and instead of +2, becomes +1. IE still
internally "something 10:00", but shown is "something 11:00".
IE the shown is *not* the date I have chosen!

I could run my program as "TZ=UTC ./myprogram" to avoid that, but then I
would not have the correct output from Time(), etc functions.
Or alternatively a lot of similar problems, if I do equivalent in Gambas
(IE use only and show only the internal presentation forced to be
"something 12:00").

If there would be let's say LocalDate datatype which would not have
timezone at all, then "something 12:00" would always be shown "something
12:00" independently of timezone and internally it could be float as well.
Of course it would not have much sense if transferred as float over
internet, without data about the timezone.
But I see this as very trivial problem, just use a string instead.

However, how to fix the current problem? I'm out of ideas.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221115/29c29926/attachment.htm>

More information about the User mailing list