A date (dd/mm/yyyy) class. More...
#include <gdate.h>
Classes | |
class | LocalTime |
An overload discriminator class for Date constructors. More... | |
Public Types | |
enum | Weekday { sunday, monday, tuesday, wednesday, thursday, friday, saturday } |
enum | Month { january = 1, february, march, april, may, june, july, august, september, october, november, december } |
enum | Format { yyyy_mm_dd_slash, yyyy_mm_dd, mm_dd } |
Public Member Functions | |
Date () | |
Default constructor for the current date in the UTC timezone. More... | |
Date (const LocalTime &) | |
Constructor for the current date in the local timezone. More... | |
Date (const G::DateTime::BrokenDownTime &tm) | |
Constructor for the specified date. More... | |
Date (G::DateTime::EpochTime t) | |
Constructor for the date in the UTC timezone as at the given epoch time. More... | |
Date (G::DateTime::EpochTime t, const LocalTime &) | |
Constructor for the date in the local timezone as at the given epoch time. More... | |
Date (int year, Month month, int day_of_month) | |
Constructor for the specified date. More... | |
std::string | string (Format format=yyyy_mm_dd_slash) const |
Returns a string representation of the date. More... | |
Weekday | weekday () const |
Returns the day of the week. More... | |
std::string | weekdayName (bool brief=false) const |
Returns an english string representation of the day of the week. More... | |
int | monthday () const |
Returns the day of the month. More... | |
std::string | dd () const |
Returns the day of the month as a two-digit decimal string. More... | |
Month | month () const |
Returns the month. More... | |
std::string | monthName (bool brief=false) const |
Returns the month as a string (in english). More... | |
std::string | mm () const |
Returns the month as a two-digit decimal string. More... | |
int | year () const |
Returns the year. More... | |
std::string | yyyy () const |
Returns the year as a four-digit decimal string. More... | |
Date & | operator++ () |
Increments the date by one day. More... | |
Date & | operator-- () |
Decrements the date by one day. More... | |
bool | operator== (const Date &rhs) const |
Comparison operator. More... | |
bool | operator!= (const Date &rhs) const |
Comparison operator. More... | |
Static Public Member Functions | |
static int | yearUpperLimit () |
Returns the largest supported year value. More... | |
static int | yearLowerLimit () |
Returns the smallest supported year value. More... | |
enum G::Date::Format |
enum G::Date::Month |
enum G::Date::Weekday |
G::Date::Date | ( | ) |
Default constructor for the current date in the UTC timezone.
Definition at line 38 of file gdate.cpp.
References G::DateTime::now(), and G::DateTime::utc().
|
explicit |
Constructor for the current date in the local timezone.
Definition at line 58 of file gdate.cpp.
References G::DateTime::local(), and G::DateTime::now().
G::Date::Date | ( | const G::DateTime::BrokenDownTime & | tm | ) |
|
explicit |
Constructor for the date in the UTC timezone as at the given epoch time.
Definition at line 43 of file gdate.cpp.
References G::DateTime::utc().
G::Date::Date | ( | G::DateTime::EpochTime | t, |
const LocalTime & | |||
) |
Constructor for the date in the local timezone as at the given epoch time.
Definition at line 48 of file gdate.cpp.
References G::DateTime::local().
G::Date::Date | ( | int | year, |
Month | month, | ||
int | day_of_month | ||
) |
std::string G::Date::dd | ( | ) | const |
std::string G::Date::mm | ( | ) | const |
G::Date::Month G::Date::month | ( | ) | const |
int G::Date::monthday | ( | ) | const |
Returns the day of the month.
Definition at line 111 of file gdate.cpp.
Referenced by operator==(), and GSmtp::ServerProtocolText::receivedLine().
std::string G::Date::monthName | ( | bool | brief = false | ) | const |
Returns the month as a string (in english).
Definition at line 170 of file gdate.cpp.
Referenced by GSmtp::ServerProtocolText::receivedLine().
bool G::Date::operator!= | ( | const Date & | rhs | ) | const |
G::Date & G::Date::operator++ | ( | ) |
G::Date & G::Date::operator-- | ( | ) |
bool G::Date::operator== | ( | const Date & | rhs | ) | const |
Comparison operator.
Definition at line 277 of file gdate.cpp.
References month(), monthday(), and year().
std::string G::Date::string | ( | Format | format = yyyy_mm_dd_slash | ) | const |
G::Date::Weekday G::Date::weekday | ( | ) | const |
Returns the day of the week.
Definition at line 130 of file gdate.cpp.
References G::DateTime::epochTime(), and G::DateTime::utc().
std::string G::Date::weekdayName | ( | bool | brief = false | ) | const |
Returns an english string representation of the day of the week.
(Was weekdayString().)
Definition at line 153 of file gdate.cpp.
Referenced by GSmtp::ServerProtocolText::receivedLine().
int G::Date::year | ( | ) | const |
|
static |
|
static |
std::string G::Date::yyyy | ( | ) | const |
Returns the year as a four-digit decimal string.
(Was yearString().)
Definition at line 192 of file gdate.cpp.
Referenced by GSmtp::ServerProtocolText::receivedLine().