Lines Matching full:timestamp
54 static optional< datetime::timestamp > mock_now = none;
260 /// Internal representation for datetime::timestamp.
261 struct timestamp::impl : utils::noncopyable {
262 /// The raw timestamp as provided by libc.
267 /// \param data_ The raw timestamp to use.
278 /// Constructs a new timestamp.
281 datetime::timestamp::timestamp(std::shared_ptr< impl > pimpl_) : in timestamp() function in datetime::timestamp
287 /// Constructs a timestamp from the amount of microseconds since the epoch.
291 /// \return A new timestamp.
292 datetime::timestamp
293 datetime::timestamp::from_microseconds(const int64_t value) in from_microseconds()
299 return timestamp(std::shared_ptr< impl >(new impl(data))); in from_microseconds()
303 /// Constructs a timestamp based on user-friendly values.
314 /// \return A new timestamp.
315 datetime::timestamp
316 datetime::timestamp::from_values(const int year, const int month, in from_values()
355 return timestamp(std::shared_ptr< impl >(new impl(data))); in from_values()
359 /// Constructs a new timestamp representing the current time in UTC.
361 /// \return A new timestamp.
362 datetime::timestamp
363 datetime::timestamp::now(void) in now()
374 return timestamp(std::shared_ptr< impl >(new impl(data))); in now()
378 /// Formats a timestamp.
384 datetime::timestamp::strftime(const std::string& format) const in strftime()
402 /// Formats a timestamp with the ISO 8601 standard and in UTC.
404 /// \return A string with the formatted timestamp.
406 datetime::timestamp::to_iso8601_in_utc(void) const in to_iso8601_in_utc()
416 datetime::timestamp::to_microseconds(void) const in to_microseconds()
427 datetime::timestamp::to_seconds(void) const in to_seconds()
440 mock_now = timestamp::from_values(year, month, day, hour, minute, second, in set_mock_now()
447 /// \param mock_now_ The mock timestamp to set the time to.
449 datetime::set_mock_now(const timestamp& mock_now_) in set_mock_now()
461 datetime::timestamp::operator==(const datetime::timestamp& other) const in operator ==()
474 datetime::timestamp::operator!=(const datetime::timestamp& other) const in operator !=()
480 /// Checks if a timestamp is before another.
484 /// \return True if this timestamp comes before other; false otherwise.
486 datetime::timestamp::operator<(const datetime::timestamp& other) const in operator <()
492 /// Checks if a timestamp is before or equal to another.
496 /// \return True if this timestamp comes before other or is equal to it;
499 datetime::timestamp::operator<=(const datetime::timestamp& other) const in operator <=()
505 /// Checks if a timestamp is after another.
509 /// \return True if this timestamp comes after other; false otherwise;
511 datetime::timestamp::operator>(const datetime::timestamp& other) const in operator >()
517 /// Checks if a timestamp is after or equal to another.
521 /// \return True if this timestamp comes after other or is equal to it;
524 datetime::timestamp::operator>=(const datetime::timestamp& other) const in operator >=()
530 /// Calculates the addition of a delta to a timestamp.
534 /// \return A new timestamp in the future.
535 datetime::timestamp
536 datetime::timestamp::operator+(const datetime::delta& other) const in operator +()
538 return datetime::timestamp::from_microseconds(to_microseconds() + in operator +()
543 /// Calculates the addition of a delta to this timestamp.
547 /// \return A reference to the modified timestamp.
548 datetime::timestamp&
549 datetime::timestamp::operator+=(const datetime::delta& other) in operator +=()
556 /// Calculates the subtraction of a delta from a timestamp.
560 /// \return A new timestamp in the past.
561 datetime::timestamp
562 datetime::timestamp::operator-(const datetime::delta& other) const in operator -()
564 return datetime::timestamp::from_microseconds(to_microseconds() - in operator -()
569 /// Calculates the subtraction of a delta from this timestamp.
573 /// \return A reference to the modified timestamp.
574 datetime::timestamp&
575 datetime::timestamp::operator-=(const datetime::delta& other) in operator -=()
591 datetime::timestamp::operator-(const datetime::timestamp& other) const in operator -()
611 datetime::operator<<(std::ostream& output, const timestamp& object) in operator <<()