How to find the Current Database UTC date and time in SQL Server?
Ask by Ashutosh Kumar Verma
Updated 20 Jun 2023
There are two functions that you can use to find the current database UTC date and time in SQL Server:
The GETUTCDATE() function returns the current database system UTC date and time, in a 'YYYY-MM-DD hh:mm:ss. mmm' format.
The SYSUTCDATE() function also returns the current database system UTC date and time, but it has more fractional seconds precision.
For example, the following query will return the current database UTC date and time:
SQL
This query will return a value in the format 'YYYY-MM-DD hh:mm:ss. mmm'.
Here is the syntax for the GETUTCDATE() function:
SQL
Here is the syntax for the SYSUTCDATE() function:
SQL
Both of these functions are very efficient, and they will not block other queries from running.
GETUTCDATE():
SQL GETUTCDATE() function is returns the current Database UTC (Coordinated Universal Time) date and time SQL Server.
Example: