[Gambas-user] CDate Documentation

Claus Dietrich claus.dietrich at freenet.de
Fri Nov 18 17:57:12 CET 2022


First upon all I have to apologize that I always open a new thread

with my posts. This will be the last one with this problem.

On /Thu Nov 17 14:47:24 CET 2022 Benoit wrote:/

>By the way, does the last commit help you with dealing with CDate()?

Sorry, I had to wait until today for an up-to-date ppa-master.
Thanks for your efforts, but your modification seems to relate to
posts from others and I don't understand the approach:

1. To me, the manual entrance of a static UTC offset makes things
worse because the daylight saving is changing over the year. Hence
this syntax will provide inconsistent results over the year, also
within the own time zone.

2. To obtain a correct UTC+n parameter for a different time
zone and a different date/ time is practically feasible. I have
developed such a heavy weight routine based on tzdata but I
am assuming that nobody would use it in conjunction with the
CDate function.

I was just looking for a small modification where the resulting
Date (as datatype ) is not shifted by the current time zone offset
of the platform.

For a moment I thought about an optional boolean CDate parameter,
which tells the function, not to shift to UTC. This would maintain
compatibility, but rather looks like patch work, i.e.:

Print  CDate("11/18/2022 15:00:00")        --> 18.11.2022 16:00:00
Print  CDate("11/18/2022 15:00:00", False) --> 18.11.2022 15:00:00

On Thu Nov 17 14:44:12 CET 2022 Benoit wrote:
>Actually you should never use the CDate() function. Because it only and 
>arbitrarily interprets strings as UTC dates in the american format.

I fully agree and that's the reason for my posts.

Best regards
Claus


  
  










More information about the User mailing list