LogTimestamp
Index
Constructors
publicconstructor
Creates a new timestamp for a log entry.
Returns LogTimestamp
Properties
publicreadonlynanos
The number of nanoseconds since the Unix epoch.
publicreadonlyseconds
The number of seconds since the Unix epoch.
Methods
publictoJSON
Returns a JSON representation of the timestamp.
Returns { nanos: number; seconds: number }
nanos: number
seconds: number
publictoString
Returns a string representation of the timestamp in RFC3339 UTC "Zulu" format.
Example:
const timestamp = new LogTimestamp();
console.log(timestamp.toString());
// Output: 2021-07-29T23:27:47.000000000ZReturns string
Represents a timestamp for a log entry. The timestamp is a Unix epoch time with nanosecond precision. The timestamp is generated when the
LogTimestamp
object is created. The timestamp is immutable. The timestamp is represented as a string in the formatYYYY-MM-DDTHH:MM:SS.NNNNNNNNNZ
.