[Gambas-user] CDate Documentation

Benoit Minisini benoit.minisini at gambas-basic.org
Sun Nov 13 22:49:22 CET 2022


Le 13/11/2022 à 22:46, Benoit Minisini a écrit :
> Le 13/11/2022 à 22:25, Jussi Lahtinen a écrit :
>>
>>     Please explain how you convert a string representation of a date
>>     with no
>>     explicit timezone into a date timestamp, without an implicit 
>> timezone.
>>
>>
>> In most cases you don't need to convert at all, you just assume it is 
>> the timezone in use.
>> If you need to convert it to some specified timezone, then you need to 
>> have information what was the timezone given with the date.
>> IE you are in the same situation as we are now, expect no automatic 
>> failures.
>>
>>
>> Jussi
>>
> 
> If you want the timezone in use, just use 'Val()' then. Leave 'CDate()' 
> alone. I don't see why it is a problem.
> 
> Regards,
> 

And if you want to understand why it is like that, it's because in 2000, 
when I designed Gambas from VB, I took its date functions, but there 
were a lot of incoherences.

To fix that, I decided that some of the functions assumes GMT, and other 
the timezone in use. And in both cases I had to have one function that 
converts from string to date, and one that converts from date to string.

-- 
Benoît Minisini.



More information about the User mailing list