DateTime DateTime DateTime DateTime Struct


Represents an instant in time, typically expressed as a date and time of day.

JavaScript This type appears as the Date object.

.NET When programming with .NET, this type is hidden, and developers should use the System.DateTimeOffset structure.

C++ Similar to FILETIME but with important differences. See Remarks.

public : struct DateTime
public struct DateTime
Public Structure DateTime
var dateTime = {

   universalTime: /* Your value */

Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced v1)


JavaScript and Microsoft .NET languages do not use this type directly. In JavaScript a DateTime is projected as a Date object, and in Microsoft .NET it is projected as a System.DateTimeOffset. Each language transparently handles the conversion to the granularity and date ranges for the respective language.

In Visual C++ component extensions (C++/CX), a DateTime.UniversalTime value has the same granularity as a FILETIME (100-nanosecond intervals). For positive values, a DateTime.UniversalTime value is identical to a FILETIME value although it can only represent dates up to about 29000 C.E. A negative value represents the number of intervals prior to January 1, 1601 and can represent dates back to about 27,400 B.C.E. For the Gregorian Calendar, you can use a DateTimeFormatter to create string representations of a DateTime for dates after midnight on Year 1 C.E.

To convert the UniversalTime to SYSTEMTIME, use ULARGE_INTEGER to convert the int64 value to FILETIME, then use FileTimeToSystemTime to get SYSTEMTIME.


UniversalTime UniversalTime UniversalTime UniversalTime

A 64-bit signed integer that represents a point in time as the number of 100-nanosecond intervals prior to or after midnight on January 1, 1601 (according to the Gregorian Calendar).

This developer language is not supported.
This developer language is not supported.
This developer language is not supported.
This developer language is not supported.

See Also