CppCMS
|
This class represents a period: a pair of two date_time objects. More...
#include <booster/booster/locale/date_time.h>
Public Member Functions | |
date_time_duration (date_time const &first, date_time const &second) | |
int | get (period::period_type f) const |
int | operator/ (period::period_type f) const |
date_time const & | start () const |
date_time const & | end () const |
This class represents a period: a pair of two date_time objects.
It is generally used as syntactic sugar to calculate difference between two dates.
Note: it stores references to the original objects, so it is not recommended to be used outside of the equation you calculate the difference in.
booster::locale::date_time_duration::date_time_duration | ( | date_time const & | first, |
date_time const & | second | ||
) | [inline] |
Create an object were first represents earlier point on time line and second is later point.
date_time const& booster::locale::date_time_duration::end | ( | ) | const [inline] |
Get ending point
Referenced by get(), and operator/().
int booster::locale::date_time_duration::get | ( | period::period_type | f | ) | const [inline] |
find a difference in terms of period_type f
References booster::locale::date_time::difference(), end(), and start().
Referenced by booster::locale::period::am_pm(), booster::locale::period::day(), booster::locale::period::day_of_week(), booster::locale::period::day_of_week_in_month(), booster::locale::period::day_of_week_local(), booster::locale::period::day_of_year(), booster::locale::period::era(), booster::locale::period::extended_year(), booster::locale::period::first_day_of_week(), booster::locale::period::hour(), booster::locale::period::hour_12(), booster::locale::period::minute(), booster::locale::period::month(), booster::locale::period::second(), booster::locale::period::week_of_month(), booster::locale::period::week_of_year(), and booster::locale::period::year().
int booster::locale::date_time_duration::operator/ | ( | period::period_type | f | ) | const [inline] |
Syntactic sugar for get(f)
References booster::locale::date_time::difference(), end(), and start().
date_time const& booster::locale::date_time_duration::start | ( | ) | const [inline] |
Get starting point
Referenced by get(), and operator/().