Skip to main content

Class: Timestamp

google.protobuf.Timestamp

Represents a Timestamp.

Implements#

Constructors#

constructor#

new Timestamp(properties?)

Constructs a new Timestamp.

Parameters#

NameType
properties?ITimestamp

Properties#

nanos#

nanos: number

Timestamp nanos.

Implementation of#

ITimestamp.nanos


seconds#

seconds: Long

Timestamp seconds.

Implementation of#

ITimestamp.seconds

Methods#

toJSON#

toJSON(): Object

Converts this Timestamp to JSON.

Returns#

Object

JSON object


decode#

Static decode(reader, length?): Timestamp

Decodes a Timestamp message from the specified reader or buffer.

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?number-

Returns#

Timestamp

Timestamp


decodeDelimited#

Static decodeDelimited(reader): Timestamp

Decodes a Timestamp message from the specified reader or buffer, length delimited.

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns#

Timestamp

Timestamp


encode#

Static encode(message, writer?): Writer

Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.

Parameters#

NameTypeDescription
messageITimestampTimestamp message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


encodeDelimited#

Static encodeDelimited(message, writer?): Writer

Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.

Parameters#

NameTypeDescription
messageITimestampTimestamp message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


fromObject#

Static fromObject(object): Timestamp

Creates a Timestamp message from a plain object. Also converts values to their respective internal types.

Parameters#

NameTypeDescription
objectObjectPlain object

Returns#

Timestamp

Timestamp


toObject#

Static toObject(message, options?): Object

Creates a plain object from a Timestamp message. Also converts values to other types if specified.

Parameters#

NameTypeDescription
messageTimestampTimestamp
options?IConversionOptions-

Returns#

Object

Plain object