Skip to content

Timestamp

Timestamp type implementation which supports add, compare, and subtract operations. Timestamps are also capable of participating in dynamic function dispatch to instance methods.

new Timestamp(secondsValue, nanosValue?): Timestamp

bigint

number = 0

Timestamp

add(other): Val

Add returns a combination of the current value and other value.

Val

Val

Adder.add


compare(other): Val

Compare this value to the input other value.

Val

Val

Comparer.compare


convertToNative(typeDesc?): unknown

ConvertToNative converts the Value to a native TypeScript value according to the provided type description, or throws if the conversion is not feasible.

unknown

unknown

Val.convertToNative


convertToType(typeValue): Val

ConvertToType supports type conversions between CEL value types supported by the expression language.

RefType

Val

Val.convertToType


equal(other): Val

Equal returns true if the other value has the same type and content as the implementing value.

Val

Val

Val.equal


format(sb): void

Format appends the human-readable representation.

string[]

void


isZeroValue(): boolean

IsZeroValue returns true if the timestamp is epoch 0.

boolean


nanos(): number

Nanos returns the nanos component.

number


receive(functionName, _overload, args): Val

Receive accepts a function name, overload id, and arguments and returns a value.

string

string

Val[]

Val

Receiver.receive


seconds(): bigint

Seconds returns the unix seconds component.

bigint


subtract(subtrahend): Val

Subtract returns the result of subtracting the input from the current value.

Val

Val

Subtractor.subtract


type(): RefType

Type returns the TypeValue of the value.

RefType

Val.type


value(): object

Value returns the raw value of the instance which may not be directly compatible with the expression language types.

object

nanos: number

seconds: bigint

Val.value


withTimezone(timezone): Timestamp

withTimezone returns an equivalent timestamp carrying a native timezone location.

string

Timestamp