Table of Contents

Documentation / TimeSpan

TimeSpan

Classes

TimeSpan

Represents a time interval.

Constructors

new TimeSpan()

new TimeSpan(): TimeSpan

Returns

TimeSpan

Properties

days

days: number

Defined in

TimeSpan.ts:17

hours

hours: number

Defined in

TimeSpan.ts:20

microseconds

microseconds: number

Defined in

TimeSpan.ts:26

milliseconds

milliseconds: number

Defined in

TimeSpan.ts:23

minutes

minutes: number

Defined in

TimeSpan.ts:32

nanoseconds

nanoseconds: number

Defined in

TimeSpan.ts:29

seconds

seconds: number

Defined in

TimeSpan.ts:35

ticks

ticks: number

Defined in

TimeSpan.ts:14

totalDays

totalDays: number

Defined in

TimeSpan.ts:38

totalHours

totalHours: number

Defined in

TimeSpan.ts:41

totalMicroseconds

totalMicroseconds: number

Defined in

TimeSpan.ts:47

totalMilliseconds

totalMilliseconds: number

Defined in

TimeSpan.ts:44

totalMinutes

totalMinutes: number

Defined in

TimeSpan.ts:53

totalNanoseconds

totalNanoseconds: number

Defined in

TimeSpan.ts:50

totalSeconds

totalSeconds: number

Defined in

TimeSpan.ts:56

Methods

toJSON()

toJSON(): string

Converts the TimeSpan to a JSON string that works in JSON serialization. Returns the TimeSpan in C# compatible format: [-][d.]hh:mm:ss[.fffffff]

Returns

string

C# compatible TimeSpan string representation.

Defined in

TimeSpan.ts:159

toString()

toString(): string

Converts the TimeSpan to a C# compatible string format. Returns the TimeSpan in format: [-][d.]hh:mm:ss[.fffffff]

Returns

string

C# compatible TimeSpan string representation.

Defined in

TimeSpan.ts:117

parse()

static parse(value): TimeSpan

Parses a C# compatible TimeSpan string and returns a TimeSpan instance. The string format should match: [-][d.]hh:mm:ss[.fffffff]

Parameters
value

string

String representation of TimeSpan.

Returns

TimeSpan

A TimeSpan instance with all properties populated.

Throws

If the string format is invalid.

Defined in

TimeSpan.ts:65