Skip to main content

Duration

@iota/identity-wasm API documentation


Class: Duration

A span of time.

Methods​

toJSON()​

Call Signature​

toJSON(): Object

  • Return copy of self without private attributes.
Returns​

Object

Call Signature​

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​

seconds​

number

Returns​

Duration


minutes()​

static minutes(minutes): Duration

Create a new Duration with the given number of minutes.

Parameters​

minutes​

number

Returns​

Duration


hours()​

static hours(hours): Duration

Create a new Duration with the given number of hours.

Parameters​

hours​

number

Returns​

Duration


days()​

static days(days): Duration

Create a new Duration with the given number of days.

Parameters​

days​

number

Returns​

Duration


weeks()​

static weeks(weeks): Duration

Create a new Duration with the given number of weeks.

Parameters​

weeks​

number

Returns​

Duration


fromJSON()​

static fromJSON(json): Duration

Deserializes an instance from a JSON object.

Parameters​

json​

any

Returns​

Duration