none
Unexpected results while converting time zones on Windows Server RRS feed

  • Question

  • In working with time zone conversions, I ran into some unexpected results. The examples below show a couple of the anomalies. My understanding is that all of the EU changes to or from Summer time at the same time (through the end of March 2021, at least [end of time changes in EU]), so shouldn't the local time in the adjacent time zones always have offsets that are one hour apart, even on the day that the offsets change?

    Here is an example in PowerShell:

    $d = Get-Date '2019-10-26 20:30:00 -04:00' # Eastern Time doesn't fall back to -05:00 until November

    @( [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($d, 'W. Europe Standard Time'), [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($d, 'Central Europe Standard Time'), [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($d, 'E. Europe Standard Time') )

    (There are two lines of code there - the first one starting with "$d" and the second one starting with "@(".)

    Image

    The same example in SQL Server 2017:

    declare @nyTime datetimeoffset = convert(datetimeoffset, N'2019-10-26 20:30:00.000000 -04:00', 121);

    select @nyTime at time zone N'W. Europe Standard Time' [W. Europe Time],
       @nyTime at time zone N'Central Europe Standard Time' [Central Europe Time],
       @nyTime at time zone N'E. Europe Standard Time' [E. Europe Time];

    Image


    The server is running Windows Server 2016 with the February 2019 update KB4487006.

    (Please do not redirect this to another forum - I already got bounced from here to the SQL Server forum - who said the time zone conversions are handled by the underlying Windows OS - to the Windows forum and back here to the Windows Server forum.)

    Tuesday, April 16, 2019 4:34 PM

Answers

  • Hi,
    We can feedback it at UserVoice. If there is further update, we can update here, thank you in advance!



    Best Regards,
    Daisy Zhou


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by R,S Monday, April 22, 2019 12:51 PM
    Monday, April 22, 2019 2:49 AM
    Moderator

All replies

  • Hello,
    Thank you for posting in our TechNet forum.

    I did a test in my test environment.

    1. When I change to 
    $d = Get-Date '2019-10-27 20:30:00 -04:00' and $d = Get-Date '2019-10-28 20:30:00 -04:00', we can see the result as below:


    2. When I change to $d = Get-Date '2019-10-24 20:30:00 -04:00' and $d = Get-Date '2019-10-25 20:30:00 -04:00', we can see the result as below:



    3. I did not change anything, and I get the time of W. Europe Standard Time, Central Europe Standard Time, E. Europe Standard Time, New Zealand Standard Time, China Standard Time, India Standard Time and Eastern Standard Time, Pacific Standard Time and Central Standard Time. We can see the result as below:

    And the system determine the time of different time zone according to the following Time Zone (not W. Europe Standard Time, Central Europe Standard Time and E. Europe Standard Time  ). I think it may be that the system judges that they happened to belong to the same time (such as the above example we provided: $d = Get-Date '2019-10-26 20:30:00 -04:00' ).

    Or maybe the system thinks two of this three belong to the same time zone (such as: $d = Get-Date '2019-10-27 20:30:00 -04:00' or other date we get the same time of W. Europe Standard Time, Central Europe Standard Time).






    Best Regards,
    Daisy Zhou


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, April 17, 2019 5:01 AM
    Moderator
  • Hi,
    If this question has any update or is this issue solved? Also, for the question, is there any other assistance we could provide?

    Best Regards,
    Daisy Zhou

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, April 19, 2019 2:38 AM
    Moderator
  • A. It appears you are getting the same results that I did - 2:30 am for all three time zones for October 27th, when you would expect the adjacent time zones to have offsets that are one hour apart.

    B. >> "maybe the system thinks two of this three belong to the same time zone"

    So, from what you are saying, that means there are two problems:

    1. The system incorrectly thinks the Western European and Central European zones "belong to the same time zone" (or maybe have the same offset), and

    2. The system incorrectly thinks that the three time zones fall back (and maybe spring ahead in March) at different times, when they are purposely designed to all change together at the same time.

    C. ?? How do we get those two problems resolved? In other words, where do we report those problems so someone can take a look at them?

    D. As a more visual version of my statement that "all of the EU changes to or from Summer time at the same time (through the end of March 2021, at least)", the World Clock Oct. 27 shows that the adjacent time zones are always one hour apart, even when the time changes. (The headings on that page are the city names, but if you start at the beginning and select the time zone names, you'll see that they correspond to Western European Time, Central European Time and Eastern European Time, respectively.


    • Edited by R,S Friday, April 19, 2019 2:07 PM
    Friday, April 19, 2019 2:06 PM
  • Normally, the time offset (between UTC and local time) for adjacent time zones will differ by 1 hour. But probably daylight savings time changes at the same local time in both zones, say at 2:00 am local time. Then for one hour the offsets will differ by either zero hours or two. The zones will change to or from daylight savings time at different UTC times (by one hour). Does this explain what you observe?

    Richard Mueller - MVP Enterprise Mobility (Identity and Access)

    Friday, April 19, 2019 2:27 PM
  • No. See the link in "D" above where it clearly shows the times always being one hour apart, which makes sense when it explains that all of Europe is designed to change _together_ at the same time - ie. UTC time, rather than a specific local time.
    • Edited by R,S Friday, April 19, 2019 6:50 PM
    Friday, April 19, 2019 6:49 PM
  • Hi,
    We can feedback it at UserVoice. If there is further update, we can update here, thank you in advance!



    Best Regards,
    Daisy Zhou


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by R,S Monday, April 22, 2019 12:51 PM
    Monday, April 22, 2019 2:49 AM
    Moderator
  • Hi,
    You are welcome! I hope we can get an explanation of this question soon.

    As always, if there is any question in future, we warmly welcome you to post in this forum again. We are happy to assist you!

    Have a nice day!


     
    Best Regards,
    Daisy Zhou

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, April 23, 2019 1:53 AM
    Moderator