|
constexpr | Timestamp () noexcept=default |
|
template<typename T , typename std::enable_if< std::is_integral< T >::value, int >::type = 0> |
constexpr | Timestamp (T timestamp) noexcept |
|
| Timestamp (const char *timestamp) |
|
| Timestamp (const std::string ×tamp) |
|
bool | valid () const noexcept |
|
constexpr | operator bool () const noexcept |
| Explicit conversion into bool.
|
|
constexpr std::time_t | seconds_since_epoch () const noexcept |
| Explicit conversion into time_t.
|
|
constexpr | operator uint32_t () const noexcept |
| Explicit conversion into uint32_t.
|
|
constexpr | operator uint64_t () const noexcept |
| Explicit conversion into uint64_t.
|
|
template<typename T > |
void | operator+= (T time_difference) noexcept |
|
template<typename T > |
void | operator-= (T time_difference) noexcept |
|
std::string | to_iso () const |
|
std::string | to_iso_all () const |
|
A timestamp. Internal representation is an unsigned 32bit integer holding seconds since epoch (1970-01-01T00:00:00Z), so this will overflow in 2106. We can use an unsigned integer here, because the OpenStreetMap project was started long after 1970, so there will never be dates before that.
template<typename T , typename std::enable_if< std::is_integral< T >::value, int >::type = 0>
constexpr osmium::Timestamp::Timestamp |
( |
T |
timestamp | ) |
|
|
inlineconstexprnoexcept |
Construct a Timestamp from any integer type containing the seconds since the epoch. This will not check for overruns, you have to make sure the value fits into a uint32_t which is used internally in the Timestamp.
The constructor is not declared "explicit" so that conversions like
work.