SQL Server GETUTCDATE Function
In SQL Server, the
GETUTCDATE()
function returns the current system UTC(Coordinated Universal Time) as a datetime. This does not include the time zone offset.
This value is derived from the operating system of the computer hosting the SQL Server instance.
Syntax:
GETUTCDATE()
Parameters:
None.
Return Value:
Returns the current UTC DateTime value as DateTime type.
In the following example, the GETUTCDATE()
function returns the current UTC datetime of the computer running SQL Server instance.
SELECT GETUTCDATE() AS CurrentUTCDateTime
Use the CONVERT()
function with GETUTCDATE()
to get the current date or time portion.
SELECT CONVERT(date, GETUTCDATE()) AS CurrentUTCDate,
CONVERT(time, GETUTCDATE()) AS CurrentUTCTime;