GETUTCDATE

GETUTCDATE is a built-in function in SQL Server that returns the current Universal Time Coordinated or Coordinated Universal Time (UTC) date and time in 'YYYY-MM-DD hh:mm:ss.sss' format. The returned time is derived from the operating system of the computer on which the instance of SQL Server is running.

GETUTCDATE() AS [timestamp]

Example

SELECT GETUTCDATE() AS CurrentUTCDate;

Output

CurrentUTCDate
-------------------------------
2022-04-19 13:30:50.373

Explanation

The GETUTCDATE() function fetches the current UTC date and time from the SQL Server. The code example uses this function to return the current UTC date and time, which is displayed under the CurrentUTCDate column in the output. The actual date and time displayed will depend upon the current system timestamp at the time of execution.

For in-depth explanations and examples SQL keywords where you write your SQL, install our extension.