Skip to main content
Version: 1.3

Class: Timestamp

identity_wasm.Timestamp

Table of contents

Constructors

Methods

Constructors

constructor

new Timestamp()

Creates a new Timestamp with the current date and time.

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


parse

Static parse(input): Timestamp

Parses a Timestamp from the provided input string.

Parameters

NameType
inputstring

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

NameType
durationDuration

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

NameType
durationDuration

Returns

undefined | Timestamp


fromJSON

Static fromJSON(json): Timestamp

Deserializes an instance from a JSON object.

Parameters

NameType
jsonany

Returns

Timestamp