TimeSpan structure
Collapse the table of content
Expand the table of content

TimeSpan structure

Represents a time interval as a signed 64-bit integer value.

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

Syntax


var timeSpan = {
    duration : /* Your value */
}

Members

The TimeSpan structure has these fields.

FieldData typeDescription
Duration | duration

Number [JavaScript] | int64 [C++]

A time period expressed in 100-nanosecond units.

 

Remarks

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

In JavaScript, this structure is accessed as a value, not as an object. For example, use var a = 10000, not var a = { duration: 10000 }.

Note  In JavaScript, TimeSpan values interpreted as Number are treated as the number of millisecond intervals, not the number of 100-nanosecond intervals. Therefore, Windows.Foundation.TimeSpan values can lose precision when being ported between languages.
 

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.FoundationContract, introduced version 1.0

Namespace

Windows.Foundation
Windows::Foundation [C++]

Metadata

Windows.Foundation.FoundationContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Foundation
Windows::Foundation [C++]

Metadata

Windows.winmd

Attributes

[Version(0x06020000)]

See also

DateTime
System.TimeSpan

 

 

Show:
© 2016 Microsoft