Timestamp
Timestamp type implementation which supports add, compare, and subtract operations. Timestamps are also capable of participating in dynamic function dispatch to instance methods.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Timestamp(
secondsValue,nanosValue?):Timestamp
Parameters
Section titled “Parameters”secondsValue
Section titled “secondsValue”bigint
nanosValue?
Section titled “nanosValue?”number = 0
Returns
Section titled “Returns”Timestamp
Methods
Section titled “Methods”add(
other):Val
Add returns a combination of the current value and other value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”compare()
Section titled “compare()”compare(
other):Val
Compare this value to the input other value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”convertToNative()
Section titled “convertToNative()”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.
Parameters
Section titled “Parameters”typeDesc?
Section titled “typeDesc?”unknown
Returns
Section titled “Returns”unknown
Implementation of
Section titled “Implementation of”convertToType()
Section titled “convertToType()”convertToType(
typeValue):Val
ConvertToType supports type conversions between CEL value types supported by the expression language.
Parameters
Section titled “Parameters”typeValue
Section titled “typeValue”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”equal()
Section titled “equal()”equal(
other):Val
Equal returns true if the other value has the same type and content as the implementing value.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”format()
Section titled “format()”format(
sb):void
Format appends the human-readable representation.
Parameters
Section titled “Parameters”string[]
Returns
Section titled “Returns”void
isZeroValue()
Section titled “isZeroValue()”isZeroValue():
boolean
IsZeroValue returns true if the timestamp is epoch 0.
Returns
Section titled “Returns”boolean
nanos()
Section titled “nanos()”nanos():
number
Nanos returns the nanos component.
Returns
Section titled “Returns”number
receive()
Section titled “receive()”receive(
functionName,_overload,args):Val
Receive accepts a function name, overload id, and arguments and returns a value.
Parameters
Section titled “Parameters”functionName
Section titled “functionName”string
_overload
Section titled “_overload”string
Val[]
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”seconds()
Section titled “seconds()”seconds():
bigint
Seconds returns the unix seconds component.
Returns
Section titled “Returns”bigint
subtract()
Section titled “subtract()”subtract(
subtrahend):Val
Subtract returns the result of subtracting the input from the current value.
Parameters
Section titled “Parameters”subtrahend
Section titled “subtrahend”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”type()
Section titled “type()”type():
RefType
Type returns the TypeValue of the value.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”value()
Section titled “value()”value():
object
Value returns the raw value of the instance which may not be directly compatible with the expression language types.
Returns
Section titled “Returns”object
nanos:
number
seconds
Section titled “seconds”seconds:
bigint
Implementation of
Section titled “Implementation of”withTimezone()
Section titled “withTimezone()”withTimezone(
timezone):Timestamp
withTimezone returns an equivalent timestamp carrying a native timezone location.
Parameters
Section titled “Parameters”timezone
Section titled “timezone”string
Returns
Section titled “Returns”Timestamp