#include <boost/locale/date_time.hpp>
This class allows to manipulate various aspects of dates and times easily using arithmetic operations with periods.
General arithmetic functions:
You can also assign specific periods using assignment operator like: some_time = year * 1995 that sets the year to 1995.
boost::locale::date_time::date_time | ( | ) |
boost::locale::date_time::date_time | ( | date_time const & | other, | |
date_time_period_set const & | set | |||
) |
copy date_time and change some fields according to the set
boost::locale::date_time::date_time | ( | double | time | ) |
boost::locale::date_time::date_time | ( | double | time, | |
calendar const & | cal | |||
) |
boost::locale::date_time::date_time | ( | calendar const & | cal | ) |
boost::locale::date_time::date_time | ( | date_time_period_set const & | set | ) |
boost::locale::date_time::date_time | ( | date_time_period_set const & | set, | |
calendar const & | cal | |||
) |
assign the date_time
date_time const& boost::locale::date_time::operator= | ( | date_time_period_set const & | f | ) |
assign values to valrious periods in set f
void boost::locale::date_time::set | ( | period::period_type | f, | |
int | v | |||
) |
set specific period f value to v
int boost::locale::date_time::get | ( | period::period_type | f | ) | const |
get specific period f value
int boost::locale::date_time::operator/ | ( | period::period_type | f | ) | const [inline] |
syntactic sugar for get(f)
date_time boost::locale::date_time::operator+ | ( | period::period_type | f | ) | const [inline] |
date_time boost::locale::date_time::operator- | ( | period::period_type | f | ) | const [inline] |
date_time const& boost::locale::date_time::operator+= | ( | period::period_type | f | ) | [inline] |
date_time const& boost::locale::date_time::operator-= | ( | period::period_type | f | ) | [inline] |
date_time boost::locale::date_time::operator<< | ( | period::period_type | f | ) | const [inline] |
roll forward a date by single period f.
date_time boost::locale::date_time::operator>> | ( | period::period_type | f | ) | const [inline] |
roll backward a date by single period f.
date_time const& boost::locale::date_time::operator<<= | ( | period::period_type | f | ) | [inline] |
roll forward a date by single period f.
date_time const& boost::locale::date_time::operator>>= | ( | period::period_type | f | ) | [inline] |
roll backward a date by single period f.
date_time boost::locale::date_time::operator+ | ( | date_time_period const & | v | ) | const |
add date_time_period to the current date_time
date_time boost::locale::date_time::operator- | ( | date_time_period const & | v | ) | const |
substract date_time_period from the current date_time
date_time const& boost::locale::date_time::operator+= | ( | date_time_period const & | v | ) |
add date_time_period to the current date_time
date_time const& boost::locale::date_time::operator-= | ( | date_time_period const & | v | ) |
substract date_time_period from the current date_time
date_time boost::locale::date_time::operator<< | ( | date_time_period const & | v | ) | const |
roll current date_time forward by date_time_period v
date_time boost::locale::date_time::operator>> | ( | date_time_period const & | v | ) | const |
roll current date_time backward by date_time_period v
date_time const& boost::locale::date_time::operator<<= | ( | date_time_period const & | v | ) |
roll current date_time forward by date_time_period v
date_time const& boost::locale::date_time::operator>>= | ( | date_time_period const & | v | ) |
roll current date_time backward by date_time_period v
date_time boost::locale::date_time::operator+ | ( | date_time_period_set const & | v | ) | const |
add date_time_period_set v to the current date_time
date_time boost::locale::date_time::operator- | ( | date_time_period_set const & | v | ) | const |
substract date_time_period_set v from the current date_time
date_time const& boost::locale::date_time::operator+= | ( | date_time_period_set const & | v | ) |
add date_time_period_set v to the current date_time
date_time const& boost::locale::date_time::operator-= | ( | date_time_period_set const & | v | ) |
substract date_time_period_set v from the current date_time
date_time boost::locale::date_time::operator<< | ( | date_time_period_set const & | v | ) | const |
roll current date_time forward by date_time_period_set v
date_time boost::locale::date_time::operator>> | ( | date_time_period_set const & | v | ) | const |
roll current date_time backward by date_time_period_set v
date_time const& boost::locale::date_time::operator<<= | ( | date_time_period_set const & | v | ) |
roll current date_time forward by date_time_period_set v
date_time const& boost::locale::date_time::operator>>= | ( | date_time_period_set const & | v | ) |
roll current date_time backward by date_time_period_set v
double boost::locale::date_time::time | ( | ) | const |
Get POSIX time
The POSIX time is number of seconds since January 1st, 1970 00:00 UTC, ignoring leap seconds.
void boost::locale::date_time::time | ( | double | v | ) |
set POSIX time
The POSIX time is number of seconds since January 1st, 1970 00:00 UTC, ignoring leap seconds. This time can be fetched from Operating system clock using C function time, gettimeofdat and others.
bool boost::locale::date_time::operator== | ( | date_time const & | other | ) | const |
bool boost::locale::date_time::operator!= | ( | date_time const & | other | ) | const |
bool boost::locale::date_time::operator< | ( | date_time const & | other | ) | const |
bool boost::locale::date_time::operator> | ( | date_time const & | other | ) | const |
bool boost::locale::date_time::operator<= | ( | date_time const & | other | ) | const |
bool boost::locale::date_time::operator>= | ( | date_time const & | other | ) | const |
void boost::locale::date_time::swap | ( | date_time & | other | ) |
swaps two dates - efficient, does not throw
int boost::locale::date_time::difference | ( | date_time const & | other, | |
period::period_type | f | |||
) | const |
calculate the distance from this date_time to other in terms of perios f
int boost::locale::date_time::difference | ( | date_time const & | other, | |
period::period_type | f | |||
) |
calculate the distance from this date_time to other in terms of perios f
int boost::locale::date_time::minimum | ( | period::period_type | f | ) | const |
Get minimal possible value for current time point for a period f.
int boost::locale::date_time::maximum | ( | period::period_type | f | ) | const |
Get minimal possible value for current time point for a period f. For example in February maximum(day) may be 28 or 29, in January maximum(day)==31