#include <Date.hxx>
Public Member Functions | |
Date () | |
Default constructor. | |
Date (const Date &date) | |
Copy constructor. | |
Date (string date) | |
Copy constructor. | |
Date (int yyyymmdd) | |
Constructor. | |
Date (int yyyy, int mm, int dd=1, int hh=0, int mn=0, double sc=0) | |
Constructor. | |
Date & | operator= (const Date &) |
Assignment operator. | |
Date & | operator= (string date) |
Assignment operator. | |
void | SetDate (string date) |
Sets the date. | |
void | SetDate (int yyyymmdd) |
Sets the date. | |
void | SetDate (int yyyy, int mm, int dd=1, int hh=0, int mn=0, double sc=0) |
Sets the date. | |
bool | LeapYear (int year) const |
Is a given year a leap year? | |
bool | LeapYear () const |
Is the current year a leap year? | |
int | GetDate () const |
Returns the date in format YYYYMMDD. | |
string | GetDate (const string &format) const |
Returns the date in a given format. | |
template<class T> | |
void | GetDate (const string &format, T &date) const |
Returns the date in a given format. | |
int | GetYear () const |
Returns the year. | |
int | GetMonth () const |
Returns the month. | |
int | GetDay () const |
Returns the day. | |
int | GetHour () const |
Returns the hour. | |
int | GetMinutes () const |
Returns the minutes. | |
double | GetSeconds () const |
Returns the seconds. | |
void | AddYears (int nb_yy) |
Adds years to the current date. | |
void | AddMonths (int nb_mm) |
Adds months to the current date. | |
void | AddDays (int nb_dd) |
Adds days to the current date. | |
void | AddHours (int nb_hh) |
Adds hours to the current date. | |
void | AddMinutes (int nb_mn) |
Adds minutes to the current date. | |
void | AddSeconds (double nb_sc) |
Adds seconds to the current date. | |
void | SetYear (int yyyy) |
Sets the year. | |
void | SetMonth (int mm) |
Sets the month. | |
void | SetDay (int dd) |
Sets the day. | |
void | SetHour (int hh) |
Sets the hour. | |
void | SetMinutes (int mn) |
Sets the minutes. | |
void | SetSeconds (double sc) |
Sets the seconds. | |
int | GetOrdinalDay () const |
Returns the ordinal number of the day in the year (between 1 and 366). | |
int | GetDayNumber () const |
Returns the number of the day in the year (between 0 and 365). | |
int | GetNumberOfDays () const |
Returns the number of days in the year before the current day. | |
int | GetDaysFrom (Date date) const |
Returns the number of days from a given date. | |
double | GetSecondsFrom (Date date) const |
Returns the number of seconds from a given date. | |
int | GetNumberOfHours () const |
Returns the number of hours in the year before the current date. | |
int | GetNumberOfMinutes () const |
Returns the number of minutes in the year before the current date. | |
double | GetNumberOfSeconds () const |
Returns the number of seconds in the year before the current date. | |
int | GetWeekDay () const |
Returns the week day. |
Talos::Date::Date | ( | const Date & | date | ) |
Copy constructor.
date | date to be copied. |
Talos::Date::Date | ( | string | date | ) |
Copy constructor.
date | date in format YYYY, YYYYMM, YYYYMMDD, YYYYMMDDHH, YYYYMMDDHHMM or YYYYMMDDHHMMSS, with each item (YYYY, MM, DD, etc.) possibly delimited with any character(s). |
Talos::Date::Date | ( | int | yyyymmdd | ) |
Constructor.
yyyymmdd | date in format YYYYMMDD. |
Talos::Date::Date | ( | int | yyyy, | |
int | mm, | |||
int | dd = 1 , |
|||
int | hh = 0 , |
|||
int | mn = 0 , |
|||
double | sc = 0 | |||
) |
Constructor.
yyyy | year. | |
mm | month. | |
dd | day. | |
hh | hour. | |
mn | minutes. | |
sc | seconds. |
Assignment operator.
date | date to be copied. |
Date & Talos::Date::operator= | ( | string | date | ) |
Assignment operator.
date | date in format YYYY, YYYYMM, YYYYMMDD, YYYYMMDDHH, YYYYMMDDHHMM or YYYYMMDDHHMMSS, with each item (YYYY, MM, DD, etc.) possibly delimited with any character(s). |
void Talos::Date::SetDate | ( | string | date | ) |
Sets the date.
date | date in format YYYY, YYYYMM, YYYYMMDD, YYYYMMDDHH, YYYYMMDDHHMM or YYYYMMDDHHMMSS, with each item (YYYY, MM, DD, etc.) possibly delimited with any character(s). |
void Talos::Date::SetDate | ( | int | yyyymmdd | ) |
Sets the date.
yyyymmdd | date in format YYYYMMDD. |
void Talos::Date::SetDate | ( | int | yyyy, | |
int | mm, | |||
int | dd = 1 , |
|||
int | hh = 0 , |
|||
int | mn = 0 , |
|||
double | sc = 0 | |||
) |
Sets the date.
yyyy | year. | |
mm | month. | |
dd | day. | |
hh | hour. | |
mn | minutes. | |
sc | seconds. |
bool Talos::Date::LeapYear | ( | int | year | ) | const |
Is a given year a leap year?
year | year. |
bool Talos::Date::LeapYear | ( | ) | const |
Is the current year a leap year?
int Talos::Date::GetDate | ( | ) | const |
Returns the date in format YYYYMMDD.
string Talos::Date::GetDate | ( | const string & | format | ) | const |
Returns the date in a given format.
'format' defines the format of the output. Special sequences are y, m, d, h, i, s for the year, the month, the day, the hour, the minutes and the seconds respectively.
format | format. |
void Talos::Date::GetDate | ( | const string & | format, | |
T & | date | |||
) | const |
Returns the date in a given format.
'format' defines the format of the output. Special sequences are y, m, d, h, i, s for the year, the month, the day, the hour, the minutes and the seconds respectively.
format | format. | |
date | (output) the date in format 'format'. |
int Talos::Date::GetYear | ( | ) | const |
Returns the year.
int Talos::Date::GetMonth | ( | ) | const |
Returns the month.
int Talos::Date::GetDay | ( | ) | const |
Returns the day.
int Talos::Date::GetHour | ( | ) | const |
Returns the hour.
int Talos::Date::GetMinutes | ( | ) | const |
Returns the minutes.
double Talos::Date::GetSeconds | ( | ) | const |
Returns the seconds.
void Talos::Date::AddYears | ( | int | nb_yy | ) |
Adds years to the current date.
nb_yy | number of years. |
void Talos::Date::AddMonths | ( | int | nb_mm | ) |
Adds months to the current date.
nb_mm | number of months. |
void Talos::Date::AddDays | ( | int | nb_dd | ) |
Adds days to the current date.
nb_dd | number of days. |
void Talos::Date::AddHours | ( | int | nb_hh | ) |
Adds hours to the current date.
nb_hh | number of hours. |
void Talos::Date::AddMinutes | ( | int | nb_mn | ) |
Adds minutes to the current date.
nb_mn | number of minutes. |
void Talos::Date::AddSeconds | ( | double | nb_sc | ) |
Adds seconds to the current date.
nb_sc | number of seconds. |
void Talos::Date::SetYear | ( | int | yyyy | ) |
Sets the year.
yyyy | the year. |
void Talos::Date::SetMonth | ( | int | mm | ) |
Sets the month.
mm | the month. |
void Talos::Date::SetDay | ( | int | dd | ) |
Sets the day.
dd | the day. |
void Talos::Date::SetHour | ( | int | hh | ) |
Sets the hour.
hh | the hour. |
void Talos::Date::SetMinutes | ( | int | mn | ) |
Sets the minutes.
mn | minutes. |
void Talos::Date::SetSeconds | ( | double | sc | ) |
Sets the seconds.
sc | seconds. |
int Talos::Date::GetOrdinalDay | ( | ) | const |
Returns the ordinal number of the day in the year (between 1 and 366).
int Talos::Date::GetDayNumber | ( | ) | const |
Returns the number of the day in the year (between 0 and 365).
int Talos::Date::GetNumberOfDays | ( | ) | const |
Returns the number of days in the year before the current day.
int Talos::Date::GetDaysFrom | ( | Date | date | ) | const |
Returns the number of days from a given date.
date | the reference date. |
double Talos::Date::GetSecondsFrom | ( | Date | date | ) | const |
Returns the number of seconds from a given date.
date | the reference date. |
int Talos::Date::GetNumberOfHours | ( | ) | const |
Returns the number of hours in the year before the current date.
int Talos::Date::GetNumberOfMinutes | ( | ) | const |
Returns the number of minutes in the year before the current date.
double Talos::Date::GetNumberOfSeconds | ( | ) | const |
Returns the number of seconds in the year before the current date.
int Talos::Date::GetWeekDay | ( | ) | const |
Returns the week day.
Week days are refered as follows: