Create Azure SQL Server with my local time (UTC+8)

MrYian 21 Reputation points
2021-08-20T12:02:15.407+00:00

experts, i would like to create a azure SQL DB with my local time, when i query select getdate() which need to return UTC+8 result. please provide me the guidance,
thanks.

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. cheong00 3,486 Reputation points Volunteer Moderator
    2021-08-21T08:42:04.583+00:00

    The only chance to set timezone is on instance creation only.

    https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/timezones-overview

    And make sure you select "SQL managed instance" instead of "Azure SQL".

    125251-azuretimezone.png


3 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2021-08-20T12:13:17.113+00:00

    Hi @MrYian ,

    maybe these links are helpful:

    https://techcommunity.microsoft.com/t5/azure-database-support-blog/lesson-learned-4-modifying-the-default-time-zone-for-your-local/ba-p/368798
    https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/timezones-overview

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  2. Olaf Helper 47,436 Reputation points
    2021-08-20T12:24:05.193+00:00

    Use the function "AT TIME ZONE (Transact-SQL)" to convert UTC timestamp to your local time zone.


  3. Tom Phillips 17,771 Reputation points
    2021-08-20T14:24:53.057+00:00

    This is really and Azure question, not a SQL Server question.

    All AzureSQL instances are set to UTC and cannot be changed.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.