NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
time.cpp File Reference
#include "ndn-cxx/util/time.hpp"
#include "ndn-cxx/util/time-custom-clock.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>
#include <sstream>
Include dependency graph for time.cpp:

Go to the source code of this file.


 Copyright (c) 2011-2015 Regents of the University of California.


typedef boost::chrono::steady_clock ndn::time::base_steady_clock


void ndn::time::setCustomClocks (shared_ptr< CustomSteadyClock > steadyClock=nullptr, shared_ptr< CustomSystemClock > systemClock=nullptr)
 Set custom system and steady clocks. More...
const system_clock::time_point & ndn::time::getUnixEpoch ()
 Return a system_clock::time_point representing the UNIX time epoch, i.e., 00:00:00 UTC on 1 January 1970. More...
milliseconds ndn::time::toUnixTimestamp (const system_clock::time_point &point)
 Convert system_clock::time_point to UNIX timestamp. More...
system_clock::time_point ndn::time::fromUnixTimestamp (milliseconds duration)
 Convert UNIX timestamp to system_clock::time_point. More...
static boost::posix_time::ptime ndn::time::convertToPosixTime (const system_clock::time_point &timePoint)
std::string ndn::time::toIsoString (const system_clock::time_point &timePoint)
 Convert to the ISO 8601 string representation, basic format (YYYYMMDDTHHMMSS,fffffffff). More...
std::string ndn::time::toIsoExtendedString (const system_clock::time_point &timePoint)
 Convert to the ISO 8601 string representation, extended format (YYYY-MM-DDTHH:MM:SS,fffffffff). More...
static system_clock::time_point ndn::time::convertToTimePoint (const boost::posix_time::ptime &ptime)
system_clock::time_point ndn::time::fromIsoString (const std::string &isoString)
 Convert from the ISO 8601 basic string format (YYYYMMDDTHHMMSS,fffffffff) to the internal time format. More...
system_clock::time_point ndn::time::fromIsoExtendedString (const std::string &isoString)
 Convert from the ISO 8601 extended string format (YYYY-MM-DDTHH:MM:SS,fffffffff) to the internal time format. More...
std::string ndn::time::toString (const system_clock::time_point &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::time_point 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...


static shared_ptr< CustomSystemClock > ndn::time::g_systemClock
static shared_ptr< CustomSteadyClock > ndn::time::g_steadyClock