Documentation / TimeSpan
TimeSpan
Classes
TimeSpan
Represents a time interval.
Constructors
new TimeSpan()
new TimeSpan():
TimeSpan
Returns
Properties
days
days:
number
Defined in
hours
hours:
number
Defined in
microseconds
microseconds:
number
Defined in
milliseconds
milliseconds:
number
Defined in
minutes
minutes:
number
Defined in
nanoseconds
nanoseconds:
number
Defined in
seconds
seconds:
number
Defined in
ticks
ticks:
number
Defined in
totalDays
totalDays:
number
Defined in
totalHours
totalHours:
number
Defined in
totalMicroseconds
totalMicroseconds:
number
Defined in
totalMilliseconds
totalMilliseconds:
number
Defined in
totalMinutes
totalMinutes:
number
Defined in
totalNanoseconds
totalNanoseconds:
number
Defined in
totalSeconds
totalSeconds:
number
Defined in
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
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
parse()
staticparse(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
A TimeSpan instance with all properties populated.
Throws
If the string format is invalid.