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  {
  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
FXDateaddDays (FXint d)
FXDateaddMonths (FXint m)
FXDateaddYears (FXint y)
FXDateoperator= (const FXDate &date)
FXDateoperator+= (FXint x)
FXDateoperator-= (FXint x)
FXDateoperator++ ()
FXDateoperator-- ()
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 FXcharmonthName (FXint mo)
static const FXcharmonthNameShort (FXint mo)
static const FXchardayName (FXint dy)
static const FXchardayNameShort (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)
FXStreamoperator<< (FXStream &store, const FXDate &d)
FXStreamoperator>> (FXStream &store, FXDate &d)


Detailed Description

Gregorian date class, which is useful for calendrical calculations.

Member Enumeration Documentation

anonymous enum

Names for the months.

Names for the weekdays

Enumerator:
Sun 
Mon 
Tue 
Wed 
Thu 
Fri 
Sat 


Constructor & Destructor Documentation

FX::FXDate::FXDate (  )  [inline]

Default constructor.

FX::FXDate::FXDate ( const FXDate date  )  [inline]

Copy constructor.

FX::FXDate::FXDate ( FXuint  jd  )  [inline]

Initialize with julian day number.

FX::FXDate::FXDate ( FXint  yr,
FXint  dy 
)

Initialize with year and day of year.

FX::FXDate::FXDate ( FXint  yr,
FXint  mo,
FXint  dy 
)

Initialize with year, month, and day of month.


Member Function Documentation

void FX::FXDate::setJulian ( FXuint  jd  )  [inline]

Set julian day number.

FXuint FX::FXDate::getJulian (  )  const [inline]

Get julian day number.

void FX::FXDate::setDate ( FXint  yr,
FXint  dy 
)

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.

void FX::FXDate::setDate ( FXint  yr,
FXint  mo,
FXint  dy 
)

Set date to year, month, and day of month.

void FX::FXDate::getDate ( FXint yr,
FXint mo,
FXint dy 
) const

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

Return day of the month.

FXint FX::FXDate::month (  )  const

Return month.

FXint FX::FXDate::year (  )  const

Return year.

FXint FX::FXDate::dayOfWeek (  )  const

Return day of the week.

FXint FX::FXDate::dayOfYear (  )  const

Return day of year.

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.

FXDate& FX::FXDate::addDays ( FXint  d  ) 

Add d days to this date.

FXDate& FX::FXDate::addMonths ( FXint  m  ) 

Add m months to this date; day of month is adjusted for leap-years.

FXDate& FX::FXDate::addYears ( FXint  y  ) 

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.

static FXint FX::FXDate::daysInMonth ( FXint  yr,
FXint  mo 
) [static]

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]

Get the name of the day.

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]

Assignment.

FXDate& FX::FXDate::operator+= ( FXint  x  )  [inline]

Assignment operators.

FXDate& FX::FXDate::operator-= ( FXint  x  )  [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]

Equality tests.

FXbool FX::FXDate::operator!= ( const FXDate date  )  const [inline]

FXbool FX::FXDate::operator< ( const FXDate date  )  const [inline]

Inequality tests.

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

FXDate operator+ ( const FXDate d,
FXint  x 
) [friend]

Add days to date yielding another date.

FXDate operator+ ( FXint  x,
const FXDate d 
) [friend]

FXint operator- ( const FXDate a,
const FXDate b 
) [friend]

Substract dates yielding days.

FXStream& operator<< ( FXStream store,
const FXDate d 
) [friend]

save to stream

FXStream& operator>> ( FXStream store,
FXDate d 
) [friend]

load from stream

Copyright © 1997-2009 Jeroen van der Zijp