Skip to content

Instantly share code, notes, and snippets.

View ebbypeter's full-sized avatar

Ebby Peter ebbypeter

View GitHub Profile
@ebbypeter
ebbypeter / Azure SQL - Time Zones.md
Created December 14, 2023 20:08
Azure SQL - Time Zones

Azure SQL - Time Zones

Azure SQL Timezone is always UTC. This cannot be changed. For Azure Managed SQL Servers, the timezone can be changed during deployment. However, this cannot be changed after that.

We can create a SQL function to convert the DateTime from UTC to a specific time zone if the dates in local timezone is important for business function.

CREATE FUNCTION dReturnDate( @dFecha as datetime)
RETURNS DATETIME
AS

Keybase proof

I hereby claim:

  • I am ebbypeter on github.
  • I am ebby (https://keybase.io/ebby) on keybase.
  • I have a public key ASA1nChKaEX9knnapXrzWDajyG39k8O0B_Oai95fNUeblgo

To claim this, I am signing this object: