DateTimeOffset::UtcNow Property

 

Gets a DateTimeOffset object whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is TimeSpan::Zero.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public:
property DateTimeOffset UtcNow {
	static DateTimeOffset get();
}

Property Value

Type: System::DateTimeOffset

An object whose date and time is the current Coordinated Universal Time (UTC) and whose offset is TimeSpan::Zero.

The UtcNow property computes the current Universal Coordinated Time (UTC) based on the local system's clock time and an offset defined by the local system's time zone.

The precision of the current UTC time's millisecond component depends on the resolution of the system clock. On Windows NT 3.5 and later, and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

The following example illustrates the relationship between Coordinated Universal Time (UTC) and local time.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: