Class TimeStamp

TimeStamp

Represents a timestamp object which is can be added to a VariableData .

Only available for Google Workspace add-ons that extend Google Workspace Studio.

Sample usage:

consttimeStamp=AddOnsResponseService.newTimeStamp()
.setSeconds(10086)
.setNanos(123);

Methods

MethodReturn typeBrief description
setNanos(nanos) TimeStamp Sets the nanos of the timestamp, it represents the number of nanoseconds within the current second.
setSeconds(seconds) TimeStamp Sets the seconds of the timestamp, it represents the number of seconds since the Unix epoch(January 1, 1970, 00:00:00 UTC).

Detailed documentation

setNanos(nanos)

Sets the nanos of the timestamp, it represents the number of nanoseconds within the current second.

Parameters

NameTypeDescription
nanosIntegerThe nanos of the timestamp.

Return

TimeStamp — This time stamp object, for chaining.


setSeconds(seconds)

Sets the seconds of the timestamp, it represents the number of seconds since the Unix epoch(January 1, 1970, 00:00:00 UTC).

Parameters

NameTypeDescription
secondsIntegerThe seconds of the timestamp.

Return

TimeStamp — This time stamp object, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月03日 UTC.