System.DateTime.UtcNow Property

Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).

Syntax

public static DateTime UtcNow { get; }

Value

A DateTime instance set to the current date and time in coordinated universal time (UTC).

Remarks

The resolution of this property depends on the system timer.

Windows NT 3.5 and later

10 milliseconds

Windows 98

55 milliseconds

Starting with the .NET Framework version 2.0, the return value is a DateTime whose DateTime.Kind property returns DateTimeKind.Utc.

An alternative to using DateTime.UtcNow is DateTimeOffset.UtcNow. While the former indicates that a date and time value is Coordinated Universal Time (UTC) by assigning DateTimeKind.Utc to its DateTime.Kind property, the latter assigns the date and time value the UTC time's offset (equal to TimeSpan.Zero).

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0