Date Class


Topics:

Overview
Conditional Directives
Type Definitions
Functions


Overview

The date class is used by database applications to represent system date values independently of the operating system or hardware platform used. The CDate class represents a date type using a two-digit month, a two-digit day, and a four-digit year:

__UBYTE__ Month;
__UBYTE__ Day;
gxUINT16 Year;

The type definitions and classes use to represent unsigned bytes and unsigned short integers are used to create platform interoperable date strings that can be written to database files.


Conditional Directives

__USE_CPP_IOSTREAM__ - Conditional directive used to enable CPP iostream functions.


Functions

CDate::CDate()
CDate::GetDay()
CDate::GetMonth()
CDate::GetYear()
CDate::SetDate()
CDate::SetDay()
CDate::SetMonth()
CDate::SetYear()
CDate::SizeOf()
CDate::c_str()
CDate::day_c_str()
CDate::month_c_str()
CDate::year_c_str()

CDate::CDate() - Default class constructor.

CDate::CDate(__UBYTE__ month, __UBYTE__ day, gxUINT16 year) - Class constructor used to construct a CDate object with a specified month, day, and year.

CDate::CDate(const CDate& ob) - Class copy constructor use to copy construct a CDate object.

CDate& CDate::operator=(const CDate& ob) - Assignment operator used to assign the specified CDate object to the object that invoked the call.

__UBYTE__ CDate::GetDay() - Public member function that returns the current day.

__UBYTE__ CDate::GetMonth() - Public member function that returns the current month.

gxUINT16 CDate::GetYear() - Public member function that returns the current year.

void CDate::SetDate(__UBYTE__ month, __UBYTE__ day, gxUINT16 year) - Public member function used to set the month, the day, and the year.

void CDate::SetDay(__UBYTE__ byte) - Public member function used to set the day.

void CDate::SetMonth(__UBYTE__ byte) - Public member function used to set the month

void CDate::SetYear(gxUINT16 uint16) - Public member function used to set the year.

unsigned CDate::SizeOf() - Public member function that returns the size of a CDate object.

char *CDate::c_str() - Public member function that returns the month, day and year in the form of a null-terminated string: MM/DD/YYYY. The calling function is responsible for freeing the memory allocated for the string returned by this function.

char *CDate::day_c_str() - Public member function that returns the day in the form of a null-terminated string. The calling function is responsible for freeing the memory allocated for the string returned by this function.

char *CDate::month_c_str() - Public member function that returns the month in the form of a null-terminated string. The calling function is responsible for freeing the memory allocated for the string returned by this function.

char *CDate::year_c_str() - Public member function that returns the year in the form of a null-terminated string. The calling function is responsible for freeing the memory allocated for the string returned by this function.


End Of Document