Problem with timezone and DST

Hi Folks,

I think there is a problem with TimeZone method.
it does not take into account the DST (daylight saving time)
if I create today, in France, a new datetime( 2024, 10, 15, 0, 0, 0, 0,tz)
where tz is Timezone.current
then the date is one day before
because we changed time on 27th october
so TimeZone.current today is one hour less than timezone.current on the datetime I ask for.

we should be able to get timezone.current(someDateTime) ?

wanting your comment(s) on this topic.

thanks.

Can’t reproduce on mac using America/Chicago (current TZ).

What do you get using this code?

var tz as TimeZone = TimeZone.Current
System.DebugLog tz.Abbreviation
System.DebugLog tz.SecondsFromGMT.ToString
var dt as new DateTime(2024, 10, 15, 0, 0, 0, 0, tz)
System.DebugLog dt.ToString
System.DebugLog dt.Timezone.Abbreviation
System.DebugLog dt.Timezone.SecondsFromGMT.ToString

I get:

12:33:59 PM : My Application Launched
12:34:00 PM : America/Chicago
            : -21600
            : Oct 15, 2024 at 12:00:00 AM
            : America/Chicago
            : -18000
12:34:13 PM : My Application Ended

DST changed November 3rd.

seems you’re right

19:39:38 : test Launched
         : Europe/Paris
         : 3600
         : 15 oct. 2024 à 00:00:00
         : Europe/Paris
         : 7200
19:39:40 : test Ended

I have a problem that may be in the tempusdominus javascript library, that returns a bad timezone in the same conditions… at least I may be able to correct it with xojo…
thanks.