Skip to main content

Timestamp

@iota/identity-wasm API documentation


Class: Timestamp

A parsed Timestamp.

Constructors​

new Timestamp()​

new Timestamp(): Timestamp

Creates a new Timestamp with the current date and time.

Returns​

Timestamp

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


parse()​

static parse(input): Timestamp

Parses a Timestamp from the provided input string.

Parameters​

input​

string

Returns​

Timestamp


nowUTC()​

static nowUTC(): Timestamp

Creates a new Timestamp with the current date and time.

Returns​

Timestamp


toRFC3339()​

toRFC3339(): string

Returns the Timestamp as an RFC 3339 String.

Returns​

string


checkedAdd()​

checkedAdd(duration): undefined | Timestamp

Computes self + duration

Returns null if the operation leads to a timestamp not in the valid range for RFC 3339.

Parameters​

duration​

Duration

Returns​

undefined | Timestamp


checkedSub()​

checkedSub(duration): undefined | Timestamp

Computes self - duration

Returns null if the operation leads to a timestamp not in the valid range for RFC 3339.

Parameters​

duration​

Duration

Returns​

undefined | Timestamp


fromJSON()​

static fromJSON(json): Timestamp

Deserializes an instance from a JSON object.

Parameters​

json​

any

Returns​

Timestamp