Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).
A DateTime instance set to the current date and time in coordinated universal time (UTC).
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).