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

FBwDate Class Reference

Class for representing dates. More...

#include <FBwDate.h>

Inheritance diagram for FBwDate:

FBwDateTime List of all members.

Public Methods

 FBwDate ()
 Default constructor.

 FBwDate (long jdn)
 Constructor.

 FBwDate (int y, int m, int d)
 Constructor.

 FBwDate (const char *s)
 Constructor.

 FBwDate (const string &s)
 Constructor.

 FBwDate (const tm &tim)
 Constructor.

 FBwDate (const FBwDate &d)
 Copy conrtuctor.

FBwDate & operator= (const FBwDate &d)
 Asignment operator.

void IncMonth (int nMon)
 Transform date to same day on next month.

int operator< (const FBwDate &d) const
 less than operator

int operator<= (const FBwDate &d) const
 less or equal than operator

int operator== (const FBwDate &d) const
 equality operator

int operator!= (const FBwDate &d) const
 inequality operator

int operator== (const string &d) const
 compares for equality

int operator> (const FBwDate &d) const
 greater than operator

int operator>= (const FBwDate &d) const
 greater or equal than operator

FBwDate & operator++ ()
 preincrement operator

FBwDate operator+ (long v) const
 Day Add operator.

FBwDate & operator+= (long v)
 Day Inplace Add operator.

FBwDate operator- (long v) const
 substraction operator

FBwDate & operator-= (long v)
 inplace substraction operator

long operator- (const FBwDate &d) const
 substraction operator

string DateString (const char *format=0) const
 date as a formated string

long DateNum () const
 returns number of days from reference to current date

int dayofw () const
 Returns a number representing the day of the week.

void CurrentDate ()
 sets date as the current day

time_t MkDate (tm *tim) const
 converts Date to time_t structure

int DayOfYear () const
 Gets number representing day of the year from 0 to 365.

string NameOfDay () const
 Gets name of day using current locale.

string NameOfMonth () const
 Gets name of month using current locale.

string AbNameOfDay () const
 Gets abreviated name of day using current locale.

string AbNameOfMonth () const
 Gets abreviated name of month using current locale.

void EncodeDate (int Year, int Month, int Day)
 sets date from Year, Month and Day values

void DecodeDate (int &Y, int &M, int &D) const
 gets Year, Day and Month values from date

virtual const char * GetFormat ()

Public Attributes

FBwDate FirstOfMonth () const
 Gets first day of month.

FBwDate LastOfMonth () const
 Gets last day of month.

FBwDate FirstOfWeek () const
 Gets first day of week.

FBwDate LastOfWeek () const
 Gets last day of week.

FBwDate FirstOfYear () const
 Gets first day of year.

FBwDate LastOfYear () const
 Gets last day of year.


Protected Methods

virtual void ParseDate (const char *s, long &Y, long &M, long &D)
 parses a string to get date

int AdjustCentury (int Y)
 Adjusts century for 2 digit years.

void SetDate (long dn)

Friends

void SetDefaultDateFormat (const char *form)
 Sets default format for DateString.

void SetEpoch (int Year, int Century)
 Sets epoch.


Detailed Description

Class for representing dates.


Constructor & Destructor Documentation

FBwDate::FBwDate long    jdn
 

Constructor.

Sets date to reference date plus jdn where reference date is: 12/15/1582 /mm/dd/yyyy

FBwDate::FBwDate int    y,
int    m,
int    d
 

Constructor.

Sets date from year, month day value

Parameters:
y:  year
m:  month
d:  day

FBwDate::FBwDate const char *    s
 

Constructor.

Sets date after parsing s

FBwDate::FBwDate const string &    s
 

Constructor.

Sets date after parsing s

FBwDate::FBwDate const tm &    tim
 

Constructor.

Sets date from standard c tm struct


Member Function Documentation

string FBwDate::DateString const char *    format = 0 const
 

date as a formated string

format paramater like strftime, formated string must not exceed MX_FRMDATE chars. If format==0 then the small date format is applied, currently is x

int FBwDate::dayofw   const
 

Returns a number representing the day of the week.

-Days of the Week:

  1. Sunday
  2. Monday
  3. Tuesday
  4. Wednesday
  5. Thirsday
  6. Friday
  7. Saturday

void FBwDate::IncMonth int    nMon
 

Transform date to same day on next month.

For ex. if date is '15/12/2002' then after IncMonth(1) the date will be '15/1/2003'. In case of current date is 1/29.... the date obtained is 2/28... for non leap years

FBwDate FBwDate::operator+ long    v const [inline]
 

Day Add operator.

The resulting date is the current date plus v days

FBwDate& FBwDate::operator+= long    v [inline]
 

Day Inplace Add operator.

The current date is the current date plus v days

void FBwDate::ParseDate const char *    s,
long &    Y,
long &    M,
long &    D
[protected, virtual]
 

parses a string to get date

Parses a string to get Year,Month and day values

Parameters:
s:  string to parse
Y:  year
M:  month
D:  day


The documentation for this class was generated from the following files:
Generated on Fri Jan 31 08:30:03 2003 for fbwrap by doxygen1.2.17