System clock. More...
#include <time.hpp>
Public Types | |
typedef BOOST_SYSTEM_CLOCK_DURATION | duration |
typedef duration::rep | rep |
typedef duration::period | period |
typedef boost::chrono::time_point< system_clock > | time_point |
typedef time_point | TimePoint |
typedef duration | Duration |
Static Public Member Functions | |
static time_point | now () noexcept |
static std::time_t | to_time_t (const time_point &t) noexcept |
static time_point | from_time_t (std::time_t t) noexcept |
Static Public Attributes | |
static constexpr bool | is_steady = false |
System clock.
System clock represents the system-wide real time wall clock.
It may not be monotonic: on most systems, the system time can be adjusted at any moment. It is the only clock that has the ability to be displayed and converted to/from UNIX timestamp.
To get current TimePoint:
system_clock::TimePoint now = system_clock::now();
To convert TimePoint to/from UNIX timestamp:
system_clock::TimePoint time = ...; uint64_t timestampInMilliseconds = toUnixTimestamp(time).count(); system_clock::TimePoint time2 = fromUnixTimestamp(milliseconds(timestampInMilliseconds));
typedef BOOST_SYSTEM_CLOCK_DURATION ndn::time::system_clock::duration |
typedef duration::rep ndn::time::system_clock::rep |
typedef duration::period ndn::time::system_clock::period |
typedef boost::chrono::time_point<system_clock> ndn::time::system_clock::time_point |
|
staticnoexcept |
Definition at line 45 of file time.cpp.
Referenced by ndn::Name::appendVersion(), ndn::security::ValidatorConfig::checkPolicy(), ndn::security::CommandInterestValidator::checkPolicy(), ndn::security::ValidityPeriod::Error::Error(), nfd::ForwarderStatusManager::ForwarderStatusManager(), ndn::security::KeyChain::getDefaultKeyParamsForIdentity(), ndn::security::SecPublicInfo::getNewKeyName(), ndn::Name::getPrefix(), ndn::security::ValidatorConfig::isEmpty(), ndn::security::v1::Certificate::isTooEarly(), ndn::security::v1::Certificate::isTooLate(), ndn::security::ValidatorConfig::load(), ndn::security::KeyChain::selfSign(), and ndn::security::KeyChain::signWithSha256().
|
staticnoexcept |
Definition at line 57 of file time.cpp.
Referenced by ndn::time::toIsoString(), and ndn::time::toString().
|
staticnoexcept |
Definition at line 63 of file time.cpp.
Referenced by ndn::time::fromIsoString(), ndn::time::fromString(), and ndn::time::getUnixEpoch().
|
static |