[Gambas-user] CDate Documentation

BB adamnt42 at gmail.com
Tue Nov 15 04:39:21 CET 2022

On 15/11/22 1:16 pm, Jussi Lahtinen wrote:
> This is related to what I have tried to explain several times. The 
> date datatype does not contain timezone information, UTC is always 
> used internally and what is shown is adjusted according to the 
> currently used timezone. Thus you can't get correct results like that. 
> It does not work like a paper calendar.
> Jussi
Maybe I am finally starting to see your issue.

But the date and time are correct in that they are a specific instance. 
I have changed the TZ in Env to several places and it always returns the 
same date and time. What I think here is wrong is that Gambas is just 
printing the Env["TZ"] value, it is not looking at the date and deciding 
which *local timezone* to print based on that date.

So if you and I agree to meet for lunch in Honolulu at 12:30 
America/Hawaii next MayDay to both of us the Date value should be 
2492170.52083333 and should not change no matter what the current TZ is 
on our respective laptops. However when you display that date (in ECT?) 
it should be 1/May/2023 12:30pm _unless you want to see what date/time 
it would be in "your time" or "my time" etc._ Is that what you are 
getting at?

AFAIK we dont have a datetime conversion function. Historically, I have 
used a postgres function to do this like "SELECT '2023-5-1 12:30 HST' AT 
TIME ZONE 'ACDT';" as it was easier than doing the complex conversion 


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

More information about the User mailing list