Skip to main content
Version: 1.5

Class: Duration

identity_wasm.Duration

A span of time.

Table of contents​

Methods​

Methods​

toJSON​

▸ toJSON(): Object

  • Return copy of self without private attributes.

Returns​

Object

▸ toJSON(): any

Serializes this to a JSON object.

Returns​

any


toString​

▸ toString(): string

Return stringified version of self.

Returns​

string


seconds​

▸ Static seconds(seconds): Duration

Create a new Duration with the given number of seconds.

Parameters​

NameType
secondsnumber

Returns​

Duration


minutes​

▸ Static minutes(minutes): Duration

Create a new Duration with the given number of minutes.

Parameters​

NameType
minutesnumber

Returns​

Duration


hours​

▸ Static hours(hours): Duration

Create a new Duration with the given number of hours.

Parameters​

NameType
hoursnumber

Returns​

Duration


days​

▸ Static days(days): Duration

Create a new Duration with the given number of days.

Parameters​

NameType
daysnumber

Returns​

Duration


weeks​

▸ Static weeks(weeks): Duration

Create a new Duration with the given number of weeks.

Parameters​

NameType
weeksnumber

Returns​

Duration


fromJSON​

▸ Static fromJSON(json): Duration

Deserializes an instance from a JSON object.

Parameters​

NameType
jsonany

Returns​

Duration