[Gambas-user] CDate Documentation

BB adamnt42 at gmail.com
Tue Nov 15 10:27:25 CET 2022

Now you've got me confused. (Inline)

On 15/11/22 7:00 pm, Benoit Minisini wrote:
> A Gambas Date is a *point in time*.
> ``LunchDate = Date(2023, 5, 1, 12, 30, 0)'' means:
> Store in LunchDate the "time point" associated with the specified 
> local date in current timezone.

I thought that we had all agreed that the *point in time*was a numerical 
(float) representation of the parameters converted to a UTC based 
equivalent. Or is it arbitrary?

If it is UTC then how do you do it? From the Env["TZ"] value? From the 
timezone offset? If so how do you get the -9.5 in winter and -10.5 in 
summer? Whatever a) the "point in time is correct AFAICS but b) then you 
must know how to get a timezone in the "active environment".

> ``Print Format(LunchDate, "ddd d mmm yy hh:nn t")'' means:
> Get that time point and print the date associated with it in local 
> format using the current timezone.
I have no problem with that apart from "t" is not correct within the 
*timeframe* for that date. IOW, I am totally happy with the way that 
Dates work but disappointed in the way Format works. I dont want it to 
change the date or time, just to print/display the correct timezone for 
the "date" concerned. So where or how does Format() get the timezone 
information? It appears to me that it is just using the "environment" 
timezone at the time the project is loaded. But this raises another 
matter, if I change the Env["TZ"] value on the fly printing the 
Env["TZ"] value works as expected *but* the Format() function still 
prints the value in force when the program was started? I would have 
expected that if I set Env["TZ"]="EET" then format would display that 
value i.e. Format(Now, "d-mmm-yy hh:nn t") would display (say) "1-May-23 
12:30 EET" but it doesn't. It still displays "1-May-23 12:30 ACDT". 
(When slightly more correctly it should display "1-May-23 12:30 ACST")

> Anyway I don't think there is an API in Linux to know what the 
> timezone is for a specific timestamp (and a specific country). 

I am having a look through the*tzset, tzname, timezone, daylight* man 
pages at the moment to see if their is anything there. (I should be 
working on that massive database conversion, but hey.)

[Aside] Oh and thanks for the Result.Editable property it has revealed 
how many errors I had in my migration code. Also you asked about the 
partitioned tables, they are giving us a throughput benefit of more than 
80%. Batch queries that used to take around 8 minutes now complete in 
seconds! :-) I am eager to see what happens when we use similar queries 
from inside Gambas but expect the same benefit.




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

More information about the User mailing list