Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXDate Class Reference

Gregorian date class, which is useful for calendrical calculations. More...

#include <FXDate.h>

List of all members.

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.
FXint month () const
 Return month.
FXint year () const
 Return year.
FXint dayOfWeek () const
 Return day of the week.
FXint dayOfYear () const
 Return day of year.
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.
FXDateaddDays (FXint d)
 Add d days to this date.
FXDateaddMonths (FXint m)
 Add m months to this date; day of month is adjusted for leap-years.
FXDateaddYears (FXint y)
 Add y years to this date; day of month is adjusted for leap-years.
FXDateoperator= (const FXDate &date)
 Assignment.
FXDateoperator+= (FXint x)
 Assignment operators.
FXDateoperator-= (FXint x)
FXDateoperator++ ()
 Pre-Increment and decrement.
FXDateoperator-- ()
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)
 Substract dates yielding days.
FXAPI FXStreamoperator<< (FXStream &store, const FXDate &d)
 save to stream
FXAPI FXStreamoperator>> (FXStream &store, FXDate &d)
 load from stream

Detailed Description

Gregorian date class, which is useful for calendrical calculations.


The documentation for this class was generated from the following file:

Copyright © 1997-2016 Jeroen van der Zijp