#include <Date.hpp>
Public Types | |
using | ImplType = boost::gregorian::date |
impl type is boost::gregorian::date | |
Public Member Functions | |
int | assumedBaseYear () const |
assumed base year | |
boost::optional< int > | baseYear () const |
user provided base year | |
void | baseYear (int baseYear) |
set base year | |
Date () | |
default constructor | |
Date (const Date &other) | |
copy constructor | |
Date (const ImplType &impl) | |
from impl | |
Date (const std::string &string) | |
constructor from string | |
Date (MonthOfYear monthOfYear, unsigned dayOfMonth) | |
Date from month, day of month. | |
Date (MonthOfYear monthOfYear, unsigned dayOfMonth, const YearDescription &yearDescription) | |
Date from YearDescription, month, and day of month. | |
Date (MonthOfYear monthOfYear, unsigned dayOfMonth, int year) | |
Date from month, day of month, year. | |
Date (tm t_tm) | |
Date from a system tm structure. | |
unsigned | dayOfMonth () const |
day of month | |
DayOfWeek | dayOfWeek () const |
day of the week | |
unsigned | dayOfYear () const |
day of year | |
bool | isLeapYear () const |
is assumed year a leap year | |
MonthOfYear | monthOfYear () const |
month of year | |
bool | operator!= (const Date &other) const |
non-equality operator | |
Date | operator+ (const Time &time) const |
addition operator | |
Date & | operator+= (const Time &time) |
assignment by addition operator | |
Time | operator- (const Date &date) const |
time duration | |
Date | operator- (const Time &time) const |
difference operator | |
Date & | operator-= (const Time &time) |
assignment by difference operator | |
bool | operator< (const Date &rhs) const |
less than operator | |
bool | operator<= (const Date &rhs) const |
less than equals operator | |
Date & | operator= (const Date &other) |
assignment operator | |
bool | operator== (const Date &other) const |
equality operator | |
bool | operator> (const Date &rhs) const |
greater than operator | |
bool | operator>= (const Date &rhs) const |
greater than equals operator | |
int | year () const |
year | |
~Date ()=default | |
destructor | |
Static Public Member Functions | |
static Date | currentDate () |
get current Date | |
static Date | fromDayOfYear (unsigned dayOfYear) |
Day of year generators. | |
static Date | fromDayOfYear (unsigned dayOfYear, const YearDescription &yearDescription) |
static Date | fromDayOfYear (unsigned dayOfYear, int year) |
static Date | fromNthDayOfMonth (NthDayOfWeekInMonth n, DayOfWeek dayOfWeek, MonthOfYear monthOfYear) |
nth weekday of month generators | |
static Date | fromNthDayOfMonth (NthDayOfWeekInMonth n, DayOfWeek dayOfWeek, MonthOfYear monthOfYear, int year) |
static bool | isLeapYear (int year) |
is year a leap year | |
static openstudio::LogChannel | logChannel () |
Date is an absolute unit of time, resolution to the day Date is simple wrapper around boost::gregorian::date.
using openstudio::Date::ImplType = boost::gregorian::date |
impl type is boost::gregorian::date
openstudio::Date::Date | ( | ) |
default constructor
|
default |
destructor
openstudio::Date::Date | ( | const ImplType & | impl | ) |
from impl
openstudio::Date::Date | ( | MonthOfYear | monthOfYear, |
unsigned | dayOfMonth ) |
Date from month, day of month.
openstudio::Date::Date | ( | MonthOfYear | monthOfYear, |
unsigned | dayOfMonth, | ||
int | year ) |
Date from month, day of month, year.
openstudio::Date::Date | ( | MonthOfYear | monthOfYear, |
unsigned | dayOfMonth, | ||
const YearDescription & | yearDescription ) |
Date from YearDescription, month, and day of month.
openstudio::Date::Date | ( | const std::string & | string | ) |
constructor from string
openstudio::Date::Date | ( | tm | t_tm | ) |
Date from a system tm structure.
openstudio::Date::Date | ( | const Date & | other | ) |
copy constructor
int openstudio::Date::assumedBaseYear | ( | ) | const |
assumed base year
boost::optional< int > openstudio::Date::baseYear | ( | ) | const |
user provided base year
void openstudio::Date::baseYear | ( | int | baseYear | ) |
set base year
unsigned openstudio::Date::dayOfMonth | ( | ) | const |
day of month
DayOfWeek openstudio::Date::dayOfWeek | ( | ) | const |
day of the week
unsigned openstudio::Date::dayOfYear | ( | ) | const |
day of year
|
static |
Day of year generators.
|
static |
|
static |
nth weekday of month generators
|
static |
bool openstudio::Date::isLeapYear | ( | ) | const |
is assumed year a leap year
|
static |
is year a leap year
|
inlinestatic |
MonthOfYear openstudio::Date::monthOfYear | ( | ) | const |
month of year
bool openstudio::Date::operator!= | ( | const Date & | other | ) | const |
non-equality operator
bool openstudio::Date::operator< | ( | const Date & | rhs | ) | const |
less than operator
bool openstudio::Date::operator<= | ( | const Date & | rhs | ) | const |
less than equals operator
bool openstudio::Date::operator== | ( | const Date & | other | ) | const |
equality operator
bool openstudio::Date::operator> | ( | const Date & | rhs | ) | const |
greater than operator
bool openstudio::Date::operator>= | ( | const Date & | rhs | ) | const |
greater than equals operator
int openstudio::Date::year | ( | ) | const |
year