0
votes

There are a lot of countries which change from CET (Central European Time) to CEST (Central European Summer Time) during DST (Daylight Saving Time).

So I thought that the Microsoft timezone database would have CEST as a time zone but I can only find CET.

CET has an UTC-Offset of +1

CEST has an UTC-Offset of +2

Would it be a problem if I would simply use another timezone with the same offset as CEST? And if so, how else am I supposed to get the CEST time from the database?

1
There is only one timezone setting. Not two (summer/winter). You use just the standard time and software know when the transition occurs. Same exists in US where Daylight savings time has been used for a long time. See : docs.microsoft.com/en-us/previous-versions/windows/embedded/… - jdweng
@jdweng the problem is that there are some countries which don't change to CEST and I think even some which change to CEST on a different date than the other countries. So how does the software know when to transition if it isn't the same for all countries using CET? - Ottxr
You can only use CET if all countries comply with the standard including summer/winter. So you have to use the timezone for the country if CEST is not supported. - jdweng
Look at the link I provided, There are two very similar timezones. One has an "an' at the end and the other doesn't. 095 Central Europe Standard Time (GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague 100 Central European Standard Time (GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb - jdweng
@jdweng thanks for the help! The timezone I have to use is: 110 W. Europe Standard Time - Ottxr

1 Answers

0
votes

The Microsoft Windows time zones that include the word "Standard" in their identifiers, such as Pacific Standard Time, Central Europe Standard Time or W. Europe Standard Time still represent the entirety of the time zone - including periods that might be under daylight saving time (aka "summer time").

You should not choose a different time zone during the DST period.

There is only one caveat: Windows computers have a date/time setting called "Adjust for daylight saving time automatically". This is on by default, and in most cases should never be turned off. However, if a user has turned it off, then they will not get the benefit of the system understanding how to apply daylight time correctly.

In .NET (as you tagged your question C#), this behavior only surfaces on Windows through APIs that use the system-local time zone, such as DateTime.Now or TimeZoneInfo.Local. If you ask for a time zone by its identifier, DST is always applied correctly regardless of the system's DST setting.