DateTime.Now.IsDaylightSavingTime() return wrong value RRS feed

  • Question

  • I'm running a application on Windows Server 2003 when i got a TimeZone problems.

    I did the following aspx page to confirm the problem:

    <%@ Import Namespace="System.Globalization.CultureInfo" %>
    <%= DateTime.UtcNow %>
    <%= DateTime.Now %>
    <%= TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now) %>
    <%= DateTime.Now.IsDaylightSavingTime() %>
    <%= TimeZoneInfo.Local.IsDaylightSavingTime(DateTime.Now) %>
    <%= TimeZone.CurrentTimeZone.StandardName %>
    <%= TimeZone.CurrentTimeZone.DaylightName %>
    <%= TimeZoneInfo.Local.Id %>

    This gives me the following result:

    10/01/2018 14:10:35 
    10/01/2018 11:10:35 
    E. South America Standard Time 
    E. South America Daylight Time 
    E. South America Standard Time



    returns False to my timezone, while it should return True?

    Also, the DateTime.Now is returning -03:00:00 offset (no daylight saving) while it should return -02:00:00 (daylight saving)

    Running the same page on another server (also Windows Serever 2003) everithing is ok.

    Any ideas on how to fix this issue?

    Wednesday, January 10, 2018 2:08 PM

All replies

  • Hi,

    Welcome to MSDN forum.

    This forum is to talk about the installation of .net framework. I recommend you go to Microsoft asp.net forum to open a new thread to talk about the problem. Thank you for understanding.

    Best regards,


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 11, 2018 6:23 AM