Share via

Time is wrong sql server azure

Paulo Jose 1 Reputation point
2021-08-26T03:28:33.843+00:00

I'm using the sql bank in the region, south brazil, but the time is wrong, it is not in accordance with the time in my region.

Azure SQL Database

1 answer

Sort by: Most helpful
  1. Alberto Morillo 35,506 Reputation points MVP Volunteer Moderator
    2021-08-26T04:40:47.29+00:00

    As you can read here SQL Azure uses UTC time on all data centers.

    You can convert UTC to Brazil time using AT TIME ZONE as explained here. See below example:

    /* Now Switch to Brasil DateTime: */  
      
    SELECT @BrasilDateTime = SWITCHOFFSET(@UTCDate, DATENAME(TZ, @UTCDate  
      
    AT TIME ZONE ‘E. South America Standard Time’))  
    

    Was this answer helpful?

    0 comments No comments

Your answer

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