First published on MSDN on Jul 27, 2016
Currently, the default time zone on Azure SQL DB is UTC . Unfortunately, there is not possible to change by server configuration or database configuration.
All Azure services use UTC time zone settings, regardless of their physical location. This also applies for SQL Azure, so if you need a custom time zone you'll have to manage that in the middle/front end tier.
One suggestion that we have is to review the new date/time function that AZURE SQL DATABASE provided as AT TIME ZONE and datetimeoffset you could find out the different time zones running the query: select * from sys.time_zone_info
For example, we could create the following function:
Running the query DBO.dReturnDate(getdate()) you could observe the results. Please, verify the timezone that you are working on with select * from sys.time_zone_info.
Currently, the default time zone on Azure SQL DB is UTC . Unfortunately, there is not possible to change by server configuration or database configuration.
All Azure services use UTC time zone settings, regardless of their physical location. This also applies for SQL Azure, so if you need a custom time zone you'll have to manage that in the middle/front end tier.
One suggestion that we have is to review the new date/time function that AZURE SQL DATABASE provided as AT TIME ZONE and datetimeoffset you could find out the different time zones running the query: select * from sys.time_zone_info
For example, we could create the following function:
CREATE FUNCTION dReturnDate( @dFecha as datetime)
returns DATETIME
as
begin
DECLARE @D AS datetimeoffset
SET @D = CONVERT(datetimeoffset, @Dfecha) AT TIME ZONE 'W. Europe Standard Time'
RETURN CONVERT(datetime, @D);
end
Running the query DBO.dReturnDate(getdate()) you could observe the results. Please, verify the timezone that you are working on with select * from sys.time_zone_info.
Updated Mar 14, 2019
Version 2.0Jose_Manuel_Jurado
Microsoft
Joined November 29, 2018
Azure Database Support Blog
Follow this blog board to get notified when there's new activity