FX::FXDate Class Reference
Gregorian date class, which is useful for calendrical calculations.
More...
#include <FXDate.h>
List of all members.
|
Public Types |
| enum | {
Sun = 0,
Mon,
Tue,
Wed,
Thu,
Fri,
Sat
} |
Public Member Functions |
| | FXDate () |
| | FXDate (const FXDate &date) |
| | FXDate (FXuint jd) |
| | FXDate (FXint yr, FXint dy) |
| | FXDate (FXint yr, FXint mo, FXint dy) |
| void | setJulian (FXuint jd) |
| FXuint | getJulian () const |
| void | setDate (FXint yr, FXint dy) |
| void | getDate (FXint &yr, FXint &dy) const |
| void | setDate (FXint yr, FXint mo, FXint dy) |
| void | getDate (FXint &yr, FXint &mo, FXint &dy) const |
| void | setTime (FXTime ns) |
| FXTime | getTime () const |
| FXint | day () const |
| FXint | month () const |
| FXint | year () const |
| FXint | dayOfWeek () const |
| FXint | dayOfYear () const |
| FXint | weekOfYear () const |
| FXbool | leapYear () const |
| FXint | daysInYear () const |
| FXint | daysInMonth () const |
| FXDate & | addDays (FXint d) |
| FXDate & | addMonths (FXint m) |
| FXDate & | addYears (FXint y) |
| FXDate & | operator= (const FXDate &date) |
| FXDate & | operator+= (FXint x) |
| FXDate & | operator-= (FXint x) |
| FXDate & | operator++ () |
| FXDate & | operator-- () |
| FXDate | operator++ (int) |
| FXDate | operator-- (int) |
| FXbool | operator== (const FXDate &date) const |
| FXbool | operator!= (const FXDate &date) const |
| FXbool | operator< (const FXDate &date) const |
| FXbool | operator<= (const FXDate &date) const |
| FXbool | operator> (const FXDate &date) const |
| FXbool | operator>= (const FXDate &date) const |
Static Public Member Functions |
| static FXbool | leapYear (FXint yr) |
| static FXint | daysInYear (FXint yr) |
| static FXint | daysInMonth (FXint yr, FXint mo) |
| static const FXchar * | monthName (FXint mo) |
| static const FXchar * | monthNameShort (FXint mo) |
| static const FXchar * | dayName (FXint dy) |
| static const FXchar * | dayNameShort (FXint dy) |
| static FXDate | localDate () |
| static FXDate | universalDate () |
Friends |
| FXDate | operator+ (const FXDate &d, FXint x) |
| FXDate | operator+ (FXint x, const FXDate &d) |
| FXint | operator- (const FXDate &a, const FXDate &b) |
| FXStream & | operator<< (FXStream &store, const FXDate &d) |
| FXStream & | operator>> (FXStream &store, FXDate &d) |
Detailed Description
Gregorian date class, which is useful for calendrical calculations.
Member Enumeration Documentation
Names for the months.
Names for the weekdays
- Enumerator:
-
| Sun |
|
| Mon |
|
| Tue |
|
| Wed |
|
| Thu |
|
| Fri |
|
| Sat |
|
Constructor & Destructor Documentation
| FX::FXDate::FXDate |
( |
|
) |
[inline] |
| FX::FXDate::FXDate |
( |
const FXDate & |
date |
) |
[inline] |
| FX::FXDate::FXDate |
( |
FXuint |
jd |
) |
[inline] |
Initialize with julian day number.
Initialize with year and day of year.
Initialize with year, month, and day of month.
Member Function Documentation
| void FX::FXDate::setJulian |
( |
FXuint |
jd |
) |
[inline] |
| FXuint FX::FXDate::getJulian |
( |
|
) |
const [inline] |
Set date to year and day of year.
| void FX::FXDate::getDate |
( |
FXint & |
yr, |
|
|
FXint & |
dy | |
|
) |
| | const |
Get year and day of year from date.
Set date to year, month, and day of month.
Get year, month, and day of month from date.
| void FX::FXDate::setTime |
( |
FXTime |
ns |
) |
|
Set date from nanoseconds since 1/1/1970.
| FXTime FX::FXDate::getTime |
( |
|
) |
const |
Get nanoseconds since 1/1/1970 from date.
| FXint FX::FXDate::day |
( |
|
) |
const |
| FXint FX::FXDate::month |
( |
|
) |
const |
| FXint FX::FXDate::year |
( |
|
) |
const |
| FXint FX::FXDate::dayOfWeek |
( |
|
) |
const |
| FXint FX::FXDate::dayOfYear |
( |
|
) |
const |
| FXint FX::FXDate::weekOfYear |
( |
|
) |
const |
Return ISO8601 week number of this date.
| FXbool FX::FXDate::leapYear |
( |
|
) |
const |
Return true if this is a leap year.
| FXint FX::FXDate::daysInYear |
( |
|
) |
const |
Return number of days in this year.
| FXint FX::FXDate::daysInMonth |
( |
|
) |
const |
Return days in this month.
Add m months to this date; day of month is adjusted for leap-years.
Add y years to this date; day of month is adjusted for leap-years.
| static FXbool FX::FXDate::leapYear |
( |
FXint |
yr |
) |
[static] |
Is the value a leap year.
| static FXint FX::FXDate::daysInYear |
( |
FXint |
yr |
) |
[static] |
Return number of days in a given year.
Return number of days in the month in given year, month.
| static const FXchar* FX::FXDate::monthName |
( |
FXint |
mo |
) |
[inline, static] |
Get the name of the month.
| static const FXchar* FX::FXDate::monthNameShort |
( |
FXint |
mo |
) |
[inline, static] |
Get the abbreviated name of the month.
| static const FXchar* FX::FXDate::dayName |
( |
FXint |
dy |
) |
[inline, static] |
| static const FXchar* FX::FXDate::dayNameShort |
( |
FXint |
dy |
) |
[inline, static] |
Get the abbreviated name of the day.
| static FXDate FX::FXDate::localDate |
( |
|
) |
[static] |
Return current local date.
| static FXDate FX::FXDate::universalDate |
( |
|
) |
[static] |
Return current universal (UTC) date.
| FXDate& FX::FXDate::operator= |
( |
const FXDate & |
date |
) |
[inline] |
| FXDate& FX::FXDate::operator++ |
( |
|
) |
[inline] |
Pre-Increment and decrement.
| FXDate& FX::FXDate::operator-- |
( |
|
) |
[inline] |
| FXDate FX::FXDate::operator++ |
( |
int |
|
) |
[inline] |
Post-Increment and decrement.
| FXDate FX::FXDate::operator-- |
( |
int |
|
) |
[inline] |
| FXbool FX::FXDate::operator== |
( |
const FXDate & |
date |
) |
const [inline] |
| FXbool FX::FXDate::operator!= |
( |
const FXDate & |
date |
) |
const [inline] |
| FXbool FX::FXDate::operator< |
( |
const FXDate & |
date |
) |
const [inline] |
| FXbool FX::FXDate::operator<= |
( |
const FXDate & |
date |
) |
const [inline] |
| FXbool FX::FXDate::operator> |
( |
const FXDate & |
date |
) |
const [inline] |
| FXbool FX::FXDate::operator>= |
( |
const FXDate & |
date |
) |
const [inline] |
Friends And Related Function Documentation
Add days to date yielding another date.
Substract dates yielding days.