Class Timestamp
Defined in File timestamp.hpp
Class Documentation
-
class Timestamp
Timestamp with nanoseconds.
Unix timestamp in nanoseconds.
Public Functions
-
explicit Timestamp(const int64_t nanoseconds)
Constructor.
- Parameters:
nanoseconds – the number of nanoseconds
-
~Timestamp()
-
int64_t nanoseconds() const
Get the number of nanoseconds.
-
std::string to_string() const
Convert the timestamp to a string.
This string can be converted back to a timestamp using from_string().
Public Static Functions
-
static std::optional<Timestamp> from_string(const std::string ×tamp)
Get a timestamp object from a string.
The string should have been generated using to_string().
- Returns:
the timestamp object, or
std::nullopt
if it fails
-
explicit Timestamp(const int64_t nanoseconds)