Timestamp
Timestamp

Represents a date/time object

Timestamp
explicit Timestamp(
uint64 nanoseconds0
)

Creates a Timestamp object based on the nanoseconds parameter

Parameters
nanoseconds
uint64

The number of nanoseconds since unix epoch (default of 0)

Timestamp
Timestamp(
uint16 year,
uint16 month,
uint16 day,
uint16 hour,
uint16 minute,
uint16 second,
uint32 milli
)

Creates a Timestamp object from the given year, month, day, hour, minute, second, millisecond parameters

Parameters
year
uint16

The year of the timestamp (ex. 2013)

month
uint16

The month of the timestamp (ex. 3)

day
uint16

The day of the timestamp (ex. 31)

hour
uint16

The hour of the timestamp (ex. 21)

minute
uint16

The minute of the timestamp (ex. 58)

second
uint16

The second of the timestamp (ex. 59)

millisecond

The milliseconds of the timestamp (ex. 123)

nanosecondsSinceEpoch

Gets the number of nanoseconds since the unix epoch

Returns

The number of nanoseconds since the unix epoch

seconds
uint64 seconds() const

Gets the number of seconds since the unix epoch

Returns

The number of nanoseconds since the unix epoch

str
std::string str() const

Gets a string representation of the Timestamp object in ISO 8601 Date/Time format.

Returns

A string representation of the Timestamp.

setTime
void setTime(
uint64 nanosSinceEpoch
)

Updates the Timestamp to the given number of nanoseconds since the unix epoch.

Parameters
nanosSinceEpoch
uint64

The number of nanoseconds since the unix epoch.

setTimeNow
void setTimeNow()

Sets the Timestamp object to the current system time in UTC

timeNow
static Timestamp timeNow()

Creates a timestamp using the current system time

Returns

A Timestamp object representing the current system time