[Gambas-user] CDate Documentation

Jussi Lahtinen jussi.lahtinen at gmail.com
Tue Nov 15 05:00:52 CET 2022


>
> 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?
>
Yes, my timezone does not matter at all, if we plan to meet in Honolulu
local time 12:30.
Try different TZ values with this code (note that wrongly given values
fallback to UTC):

Dim hDate1 As Date = CDate("12/24/2024 12:00") ''<-- here it is given as UTC
Dim hDate2 As Date = Val("12/24/2024 12:00") ''<-- here it is given as
local time

Print CStr(hDate1);; Str(hDate1) ''internal presentation & localized
presentation accordingly
Print CStr(hDate2);; Str(hDate2)


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


More information about the User mailing list