Azure SQL Database uses UTC as its database time zone. Functions such as GETDATE() return the current database time, which is UTC. If your application needs the current date and time in a specific local time zone, use AT TIME ZONE to convert the UTC value.
Quick answer: Use SYSUTCDATETIME() as the UTC source and convert it to the required Windows time zone with AT TIME ZONE.
SELECT SYSUTCDATETIME()
AT TIME ZONE 'India Standard Time' AS LocalDateTime;
For example, India Standard Time returns the current time in India (UTC+05:30). Use the appropriate Windows time zone ID for your target location.
Get the current date and time for a specific time zone
The following example converts the current UTC time to Helsinki time:
SELECT SYSUTCDATETIME()
AT TIME ZONE 'FLE Standard Time' AS HelsinkiDateTime;
AT TIME ZONE applies the time-zone rules, including daylight saving time where applicable. This is preferable to adding or subtracting a fixed number of hours because the offset can change during the year.
Get only the local date
If you only need the date rather than the time, cast the converted value to date:
SELECT CAST(
SYSUTCDATETIME() AT TIME ZONE 'India Standard Time'
AS date) AS LocalDate;
Convert a stored UTC datetime to local time
If a column stores UTC values as datetime or datetime2, first tell SQL Server that the value represents UTC and then convert it to the target time zone.
SELECT
CreatedDate AT TIME ZONE 'UTC'
AT TIME ZONE 'India Standard Time' AS LocalCreatedDate
FROM dbo.YourTable;
Reusable function
If the same conversion is required in many queries, you can wrap it in a user-defined function. For example:
CREATE OR ALTER FUNCTION dbo.GetLocalDateTime
(
@TimeZone sysname
)
RETURNS datetimeoffset
AS
BEGIN
RETURN SYSUTCDATETIME() AT TIME ZONE @TimeZone;
END;
GO
SELECT dbo.GetLocalDateTime('India Standard Time');
For simple queries, however, using AT TIME ZONE directly is usually clearer than creating a function.
Common Windows time zone IDs
| Location | Windows time zone ID |
|---|---|
| India | India Standard Time |
| UK | GMT Standard Time |
| Central Europe | W. Europe Standard Time |
| Finland | FLE Standard Time |
| Eastern US | Eastern Standard Time |
| Pacific US | Pacific Standard Time |
| Japan | Tokyo Standard Time |
| Singapore | Singapore Standard Time |
For the complete list of supported Windows time zone IDs, see Microsoft’s AT TIME ZONE documentation.
Important: keep stored timestamps in UTC
For applications that work across multiple regions, it is generally better to store timestamps in UTC and convert them to local time only when displaying or processing them for a specific region. This avoids ambiguity when daylight saving time changes.
Azure SQL Database does not provide a setting to change the database time zone from UTC. Use AT TIME ZONE when you need a local representation of a UTC timestamp.
In short: keep the data in UTC, and use AT TIME ZONE when you need the date or time for a specific location.
Visual Studio Marketplace
SSIS Catalog Migration Wizard
Extend Visual Studio with an easy way to migrate SSIS Catalog projects.
Kunal Rathi
With over 15 years of experience in data engineering and analytics, I've assisted countless clients in gaining valuable insights from their data. As a dedicated supporter of Data, Cloud and DevOps, I'm excited to connect with individuals who share my passion for this field. If my work resonates with you, we can talk and collaborate.






