...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::date_time::day_clock — A clock providing day level services based on C time_t capabilities.
// In header: <boost/date_time/date_clock_device.hpp> template<typename date_type> class day_clock { public: // types typedef date_type::ymd_type ymd_type; // public static functions static date_type local_day(); static date_type::ymd_type local_day_ymd(); static date_type::ymd_type universal_day_ymd(); static date_type universal_day(); // private static functions static ::std::tm * get_local_time(std::tm &); static ::std::tm * get_universal_time(std::tm &); };
This clock uses Posix interfaces as its implementation and hence uses the timezone settings of the operating system. Incorrect user settings will result in incorrect results for the calls to local_day.
day_clock
public static functionsstatic date_type local_day();Get the local day as a date type.
static date_type::ymd_type local_day_ymd();Get the local day as a ymd_type.
static date_type::ymd_type universal_day_ymd();Get the current day in universal date as a ymd_type.
static date_type universal_day();Get the UTC day as a date type.