none
how to change the default SQL Time zone to GMT -03:00

    Question

  • Hi all,

    when I use the query select getdate() I have the correct time, when I use the query select getutcdate(), the result is 2 hours more thant current time in Brazil.

    How to change the time zone on SQL to use the GTM -03:00 (Brasilia)?

    tks


    Certified (35) | ITIL | MCP | MCDST | MCSA1 | MCSE1 | MCT | MCTS Sharepoint | MCITP SQL | MCSA Windows 2012 | MTA Security | MCSE Windows 8 | MCSE Windows 2012 | Vencedor do Winthe7.com.br 2009, Quarto lugar Copa de Talentos Microsoft 2010

    Monday, December 16, 2013 4:42 PM

Answers

All replies

  • Hi,

    From: http://technet.microsoft.com/en-us/library/ms178635.aspx

    "This value is derived from the operating system of the computer on which the instance of SQL Server is running."

    So, unless you want to change the OS settings, you should probably use DATEADD or something http://technet.microsoft.com/en-us/library/ms186819.aspx


    Thanks, Andrew
    My blog...

    • Marked as answer by Adriano Neiva Monday, December 16, 2013 6:10 PM
    Monday, December 16, 2013 4:47 PM
  • thanks Andrew,

    but it is not so clear for me.

    I installed a new server, new sql, and restored one database from a partner. I just would like how to change the utc time to use my localtime.


    Certified (35) | ITIL | MCP | MCDST | MCSA1 | MCSE1 | MCT | MCTS Sharepoint | MCITP SQL | MCSA Windows 2012 | MTA Security | MCSE Windows 8 | MCSE Windows 2012 | Vencedor do Winthe7.com.br 2009, Quarto lugar Copa de Talentos Microsoft 2010

    Monday, December 16, 2013 5:06 PM
  • Hi,

    You can't change UTC time!

    It's an international standard, derived from what was formerly known as GMT or Greenwich Mean Time.

    On the other hand, you can change your server local time to UTC.

    Just change the Date/Time properties on the server hosting your SQL instance, swap from Brazilia timezone to UTC and that's all.


    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

    • Marked as answer by Adriano Neiva Monday, December 16, 2013 6:10 PM
    Monday, December 16, 2013 5:14 PM
  • The UTC datetime value is calculated by using the Windows OS timezone on the server.  You need to change the timezone in WINDOWS on the server.

    Monday, December 16, 2013 5:54 PM
    Moderator
  • thanks Andrew,

    but it is not so clear for me.

    I installed a new server, new sql, and restored one database from a partner. I just would like how to change the utc time to use my localtime.


    Certified (35) | ITIL | MCP | MCDST | MCSA1 | MCSE1 | MCT | MCTS Sharepoint | MCITP SQL | MCSA Windows 2012 | MTA Security | MCSE Windows 8 | MCSE Windows 2012 | Vencedor do Winthe7.com.br 2009, Quarto lugar Copa de Talentos Microsoft 2010

    Have a look at this link please:

    SQL Server Timezone Change


    sqldevelop.wordpress.com

    Monday, December 16, 2013 6:08 PM