As a database developer, I’ve found that handling time zones correctly is essential. In this comprehensive article, I’ll walk you through everything you need to know about working with UTC dates in SQL Server.
SQL Server Get UTC Date
Let’s discuss all the approaches for retrieving the UTC date in SQL Server.
Approach-1: Using GETUTCDATE() Function
The most fundamental function for working with UTC dates in SQL Server is GETUTCDATE(), which returns the current UTC date and time as a DATETIME data type.
This function does not accept any parameters and always returns the current system’s UTC date and time.
We can execute the following query for this purpose.
SELECT GETUTCDATE() AS CurrentUTCDateTime;After executing the above query, I got the expected output as shown in the screenshot below.

When working with UTC dates, you’ll frequently need to convert between UTC and local time zones.
Approach-2: Using DATEADD with Time Zone Offset
The following query can be used to convert UTC to Eastern Time (EST/EDT).
SELECT
GETUTCDATE() AS UTCDateTime,
DATEADD(HOUR, -5, GETUTCDATE()) AS EasternStandardTimeAfter executing the above query, I got the expected output as shown in the screenshot below.

Approach-3: Using AT TIME ZONE
This method works for SQL Server 2016+ versions. We can use the following query for this purpose.
SELECT
GETUTCDATE() AS UTCDateTime,
GETUTCDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'Eastern Standard Time' AS EasternTimeAfter executing the above query, I got the expected output as shown in the screenshot below.

Formatting UTC Dates
When displaying dates to users, formatting them appropriately becomes important. We can use the following query for this purpose. This will format UTC date for US format display.
SELECT FORMAT(GETUTCDATE(), 'MM/dd/yyyy hh:mm:ss tt') AS FormattedUTCDate;After executing the above query, I got the expected output as shown in the screenshot below.

UTC Date Functions Reference Table
| Function | Purpose | SQL Server Version |
|---|---|---|
| GETUTCDATE() | Returns current UTC date/time | All versions |
| SYSUTCDATETIME() | Returns current UTC with higher precision | SQL 2008+ |
| AT TIME ZONE | Converts between time zones | SQL 2016+ |
| TODATETIMEOFFSET | Converts to DATETIMEOFFSET type | SQL 2008+ |
Conclusion
Working with UTC dates in SQL Server is critical for working with global applications. By following the approaches outlined in this article, you can easily implement this in your application. Hope this will help you !!
You may also like the following articles.
- Trunc Date In SQL Server
- SQL Server Date Compare
- SQL Server GROUP BY Date
- SQL Server MAX Date
- SQL Server Add Days To Date
After working for more than 15 years in the Software field, especially in Microsoft technologies, I have decided to share my expert knowledge of SQL Server. Check out all the SQL Server and related database tutorials I have shared here. Most of the readers are from countries like the United States of America, the United Kingdom, New Zealand, Australia, Canada, etc. I am also a Microsoft MVP. Check out more here.