none
Azure TIMEZONE UTC problem. How to solve?

    Question

  • I designed my application considering the fact that, according to the specifications,
    should run on a server located in Italy.

    About a month ago, my owner decided to bring it all on Azure.

    Everything went smoothly. The only thing still to sort out is the fact that the time server isUTC.

    2 The solutions are:

    A-simple: modify a startup script to the server time (
    http://netindonesia.net/blogs/wely/archive/2011/06/26/setting-timezone-in-windows-azure.aspx
    )

    B-more laborious: Change to make any application to use UTC and
    show the time properly converted to local time.

    The solution to me seems the best solution but my doubt is that the fact that the
    server is set up with a different timezone can somehow create conflicts with
    azure.

    If this is true of the solutions would be reduced to just one.
    Monday, June 27, 2011 3:25 PM

Answers

  • Hi, I have folow your idea and I have asked to support.

    This is the response:

    Changing the server time on the Azure Virtual Machines using a startup task is not recommended,  you should rather use methods like TimeZoneInfo.ConvertTimeFromUTCTime  in your code. This is a good reference article (Coding Best Practices Using DateTime in the .NET Framework).

     

    So I will not change the server timezone.

    • Marked as answer by Wenchao Zeng Wednesday, June 29, 2011 2:30 AM
    Tuesday, June 28, 2011 3:50 PM

All replies

  • Hi stimax,

    > The server is set up with a different timezone can somehow create conflicts with azure.

    I can not think of any side effects of changing the timezone but please be aware that Azure Storage, SQL Azure are still using UTC timeone. If you want to confirm this with our auzre support, please check the following link.

    http://www.microsoft.com/windowsazure/support/

    Please click "Windows Azure" and select "Development Issues" and "Other" in the subsequent page. This service is free for now.

    Thanks.


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Tuesday, June 28, 2011 10:02 AM
  • Hi, I have folow your idea and I have asked to support.

    This is the response:

    Changing the server time on the Azure Virtual Machines using a startup task is not recommended,  you should rather use methods like TimeZoneInfo.ConvertTimeFromUTCTime  in your code. This is a good reference article (Coding Best Practices Using DateTime in the .NET Framework).

     

    So I will not change the server timezone.

    • Marked as answer by Wenchao Zeng Wednesday, June 29, 2011 2:30 AM
    Tuesday, June 28, 2011 3:50 PM
  • You may want to consult the Azure Support, why they are saying "not recommended". There must be reason / rationalle behind.

    But I am sure, if you are using the TimeZoneInfo.ConvertTimeFromUTCTime , you need to scan your entire solution and change the code one by one.

    Of course, eventually is up to you to decide which approach to go :)

     


    regards, wely
    Wednesday, June 29, 2011 4:40 AM
  • I will convert all the DateTime to DateTimeOffset (in sql server and c# code) and allwais use it.

    This Blog post is very clear about the use and the advantages of DateTimeOffset over DateTime

    http://blogs.msdn.com/b/bartd/archive/2009/03/31/the-death-of-datetime.aspx

    Wednesday, June 29, 2011 8:26 AM
  • Another message from the support that explain the reason about the "not recommended" alert.

    Changing the timezone of the server is not recommended because we cannot guarantee that the change will persist and it may cause problems with the fabric.

    Wednesday, June 29, 2011 2:37 PM
  • if you run the tzutil as start-up task, it should be permanent although the VM is being reprovisioned.

    then what does the "cannot guarantee the change will persist" mean?

    it "may" cause problems with the fabric? what's the problem?


    regards, wely
    Thursday, June 30, 2011 1:39 AM
  • for newly created application, i would recommend using UTC timezone. this is not only because the official recommendation on Windows Azure. But also to enable interfacing with other external system to be more standardized.

    We can do some magic to change Azure VM to local time, but not at SQL Azure.

    However, considering you've bunch of current existing data in local time. It would be very troublesome and much effort to convert all of your data to UTC timezone. Then one day if you are about move back to on-premise, how do you deal with those data again? convert back again, uh....

    I've got an idea mentioned here, it may not be a real solution, but it's at least a workaround to solve the issue.


    regards, wely

    • Proposed as answer by Daniell.Chong Monday, January 28, 2013 7:09 AM
    Wednesday, July 20, 2011 2:28 AM