#include "time.hpp"
#include "time-custom-clock.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <sstream>
Go to the source code of this file.
Namespaces | |
ndn | |
Copyright (c) 2011-2015 Regents of the University of California. | |
ndn::time | |
boost | |
boost::chrono | |
Typedefs | |
typedef boost::chrono::steady_clock | ndn::time::base_steady_clock |
Functions | |
void | ndn::time::setCustomClocks (shared_ptr< CustomSteadyClock > steadyClock=nullptr, shared_ptr< CustomSystemClock > systemClock=nullptr) |
Set custom system and steady clocks. More... | |
const system_clock::TimePoint & | ndn::time::getUnixEpoch () |
Get system_clock::TimePoint representing UNIX time epoch (00:00:00 on Jan 1, 1970) More... | |
milliseconds | ndn::time::toUnixTimestamp (const system_clock::TimePoint &point) |
Convert system_clock::TimePoint to UNIX timestamp. More... | |
system_clock::TimePoint | ndn::time::fromUnixTimestamp (milliseconds duration) |
Convert UNIX timestamp to system_clock::TimePoint. More... | |
static boost::posix_time::ptime | ndn::time::convertToPosixTime (const system_clock::TimePoint &timePoint) |
std::string | ndn::time::toIsoString (const system_clock::TimePoint &timePoint) |
Convert to the ISO string representation of the time (YYYYMMDDTHHMMSS,fffffffff) More... | |
static system_clock::TimePoint | ndn::time::convertToTimePoint (const boost::posix_time::ptime &ptime) |
system_clock::TimePoint | ndn::time::fromIsoString (const std::string &isoString) |
Convert from the ISO string (YYYYMMDDTHHMMSS,fffffffff) representation to the internal time format. More... | |
std::string | ndn::time::toString (const system_clock::TimePoint &timePoint, const std::string &format="%Y-%m-%d %H:%M:%S", const std::locale &locale=std::locale("C")) |
Convert time point to string with specified format. More... | |
system_clock::TimePoint | ndn::time::fromString (const std::string &timePointStr, const std::string &format="%Y-%m-%d %H:%M:%S", const std::locale &locale=std::locale("C")) |
Convert from string of specified format into time point. More... | |
Variables | |
static shared_ptr< CustomSystemClock > | ndn::time::g_systemClock |
static shared_ptr< CustomSteadyClock > | ndn::time::g_steadyClock |