Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
Gregorian date class, which is useful for calendrical calculations. More...
#include <FXDate.h>
Public Types | |
enum | { Jan =1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec } |
Names for the months. | |
enum | { Sun =0, Mon, Tue, Wed, Thu, Fri, Sat } |
Names for the weekdays. | |
Public Member Functions | |
FXDate () | |
Default constructor. | |
FXDate (const FXDate &date) | |
Copy constructor. | |
FXDate (FXuint jd) | |
Initialize with julian day number. | |
FXDate (FXint yr, FXint dy) | |
Initialize with year and day of year. | |
FXDate (FXint yr, FXint mo, FXint dy) | |
Initialize with year, month, and day of month. | |
void | setJulian (FXuint jd) |
Set julian day number. | |
FXuint | getJulian () const |
Get julian day number. | |
void | setDate (FXint yr, FXint dy) |
Set date to year and day of year. | |
void | getDate (FXint &yr, FXint &dy) const |
Get year and day of year from date. | |
void | setDate (FXint yr, FXint mo, FXint dy) |
Set date to year, month, and day of month. | |
void | getDate (FXint &yr, FXint &mo, FXint &dy) const |
Get year, month, and day of month from date. | |
void | setTime (FXTime ns) |
Set date from nanoseconds since 1/1/1970. | |
FXTime | getTime () const |
Get nanoseconds since 1/1/1970 from date. | |
FXint | day () const |
Return day of the month (1..31) | |
FXint | month () const |
Return month (1..12) | |
FXint | year () const |
Return year. | |
FXint | dayOfWeek () const |
Return day of the week. | |
FXint | dayOfYear () const |
Return day of year (1..366) | |
FXint | weekOfYear () const |
Return ISO8601 week number of this date. | |
FXbool | leapYear () const |
Return true if this is a leap year. | |
FXint | daysInYear () const |
Return number of days in this year. | |
FXint | daysInMonth () const |
Return days in this month. | |
FXDate & | addDays (FXint d) |
Add d days to this date. | |
FXDate & | addMonths (FXint m) |
Add m months to this date; day of month is adjusted for leap-years. | |
FXDate & | addYears (FXint y) |
Add y years to this date; day of month is adjusted for leap-years. | |
FXDate & | operator= (const FXDate &date) |
Assignment. | |
FXDate & | operator+= (FXint x) |
Assignment operators. | |
FXDate & | operator-= (FXint x) |
FXDate & | operator++ () |
Pre-Increment and decrement. | |
FXDate & | operator-- () |
FXDate | operator++ (int) |
Post-Increment and decrement. | |
FXDate | operator-- (int) |
FXbool | operator== (const FXDate &date) const |
Equality tests. | |
FXbool | operator!= (const FXDate &date) const |
FXbool | operator< (const FXDate &date) const |
Inequality tests. | |
FXbool | operator<= (const FXDate &date) const |
FXbool | operator> (const FXDate &date) const |
FXbool | operator>= (const FXDate &date) const |
~FXDate () | |
Destructor. | |
Static Public Member Functions | |
static FXbool | leapYear (FXint yr) |
Is the value a leap year. | |
static FXint | daysInYear (FXint yr) |
Return number of days in a given year. | |
static FXint | daysInMonth (FXint yr, FXint mo) |
Return number of days in the month in given year, month. | |
static const FXchar * | monthName (FXint mo) |
Get the name of the month. | |
static const FXchar * | monthNameShort (FXint mo) |
Get the abbreviated name of the month. | |
static const FXchar * | dayName (FXint dy) |
Get the name of the day. | |
static const FXchar * | dayNameShort (FXint dy) |
Get the abbreviated name of the day. | |
static FXDate | localDate () |
Return current local date. | |
static FXDate | universalDate () |
Return current universal (UTC) date. | |
Friends | |
FXDate | operator+ (const FXDate &d, FXint x) |
Add days to date yielding another date. | |
FXDate | operator+ (FXint x, const FXDate &d) |
FXint | operator- (const FXDate &a, const FXDate &b) |
Subtract dates yielding days. | |
FXAPI FXStream & | operator<< (FXStream &store, const FXDate &d) |
save to stream | |
FXAPI FXStream & | operator>> (FXStream &store, FXDate &d) |
load from stream | |
Gregorian date class, which is useful for calendrical calculations.
Copyright © 1997-2022 Jeroen van der Zijp |