Date Class Reference

Represents Date Data type. More...


Public Member Functions

 Date (int year, int month, int day)
 constructor with year, month, day
int set (int year, int month, int day)
 sets the date with specified year, month, day
int get (int &year, int &month, int &day) const
 get year, month, day of the date
bool isValid () const
 checks for the validity of the date
void setNull ()
 resets the date to zero
int dayOfWeek () const
 returns day of the week
const char * dayOfWeekName () const
 returns day of the week.
const char * dayOfWeekAbbr () const
 returns day of the week abbreviation values are "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
int dayOfMonth () const
 returns the day of the month.
int month () const
 returns the month Values are 1 to 12.
const char * monthName () const
 returns the month name values are "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
const char * monthAbbr () const
 returns the month name abbreviation values are "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
int parseFrom (const char *s)
 parses the date string passed and stores it It should of the format "mm/dd/yyyy"
int year () const
 returns the year

Static Public Member Functions

static const char * dayOfWeekName (int day)
 returns day of the week.
static const char * dayOfWeekAbbr (int day)
 returns day of the week abbreviation values are "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
static const char * monthName (int month)
 returns the month name values are "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
static const char * monthAbbr (int month)
 returns the month name abbreviation values are "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
static bool isValidDate (int year, int month, int day)
 checks for the validity of the date
static bool isLeapYear (int year)
 checks for leap year
static int daysInMonth (int month, int year)
 returns the number of days in the specified month of the year.


Detailed Description

Represents Date Data type.



Constructor & Destructor Documentation

Date::Date ( int  year,
int  month,
int  day 
)

constructor with year, month, day

Parameters:
year year
month month
day day


Member Function Documentation

int Date::dayOfMonth (  )  const

returns the day of the month.

Values are 1 to 31

static const char* Date::dayOfWeekName ( int  day  )  [static]

returns day of the week.

values are "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday".

const char* Date::dayOfWeekName (  )  const

returns day of the week.

values are "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday".

int Date::get ( int &  year,
int &  month,
int &  day 
) const

get year, month, day of the date

Parameters:
year year IN
month month IN
day day IN

int Date::set ( int  year,
int  month,
int  day 
)

sets the date with specified year, month, day

Parameters:
year year
month month
day day


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