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
Output
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.