25 #include "../common.hpp" 26 #include <boost/chrono.hpp> 27 #include <boost/asio/time_traits.hpp> 28 #include <boost/date_time/posix_time/posix_time_types.hpp> 33 using boost::chrono::duration;
35 typedef duration<boost::int_least32_t, boost::ratio<86400> >
days;
36 using boost::chrono::hours;
37 using boost::chrono::minutes;
38 using boost::chrono::seconds;
40 using boost::chrono::milliseconds;
41 using boost::chrono::microseconds;
42 using boost::chrono::nanoseconds;
44 using boost::chrono::duration_cast;
73 typedef duration::rep
rep;
75 typedef boost::chrono::time_point<system_clock>
time_point;
103 typedef duration::rep
rep;
106 static constexpr
bool is_steady =
true;
123 static
boost::posix_time::time_duration
124 to_posix_duration(const duration& duration);
126 friend struct
boost::asio::time_traits<steady_clock>;
194 const
std::
string& format = "%Y-%m-%d %H:%M:%S",
195 const
std::locale& locale =
std::locale("C"));
212 const
std::
string& format = "%Y-%m-%d %H:%M:%S",
213 const
std::locale& locale =
std::locale("C"));
224 template<
class CharT>
227 static std::basic_string<CharT>
231 template<
class CharT>
234 static std::basic_string<CharT>
241 #endif // NDN_TIME_HPP boost::chrono::time_point< system_clock > time_point
boost::chrono::time_point< steady_clock > time_point
Copyright (c) 2011-2015 Regents of the University of California.
system_clock::TimePoint fromIsoString(const std::string &isoString)
Convert from the ISO string (YYYYMMDDTHHMMSS,fffffffff) representation to the internal time format...
Copyright (c) 2013-2015 Regents of the University of California.
BOOST_SYSTEM_CLOCK_DURATION duration
static std::time_t to_time_t(const time_point &t) noexcept
static constexpr bool is_steady
static time_point now() noexcept
std::string toString(const system_clock::TimePoint &timePoint, const std::string &format, const std::locale &locale)
Convert time point to string with specified format.
system_clock::TimePoint fromString(const std::string &formattedTimePoint, const std::string &format, const std::locale &locale)
Convert from string of specified format into time point.
std::string toIsoString(const system_clock::TimePoint &timePoint)
Convert to the ISO string representation of the time (YYYYMMDDTHHMMSS,fffffffff)
system_clock::TimePoint fromUnixTimestamp(const milliseconds &duration)
Convert UNIX timestamp to system_clock::TimePoint.
milliseconds toUnixTimestamp(const system_clock::TimePoint &point)
Convert system_clock::TimePoint to UNIX timestamp.
static time_point from_time_t(std::time_t t) noexcept
const system_clock::TimePoint & getUnixEpoch()
Get system_clock::TimePoint representing UNIX time epoch (00:00:00 on Jan 1, 1970) ...
duration< boost::int_least32_t, boost::ratio< 86400 > > days