xbDate Methods
Chapter Updated 8/21/03
Method | Description |
---|---|
xbDate( const char * Date8 ) xbDate( const xbString & Date8 ) xbDate() | Class constructors. If no date provided, or invalid date provided, date is set to Sysdate(). |
~xbDate() | Class destructor |
xbString & CharDayOf( const char *Date8 ) xbString & CharDayOf( const xbString & Date8 ) xbString & CharDayOf() | Returns Sun - Sat day of week for a given date |
xbString & CharMonthOf( const char *Date8 ) xbString & CharMonthOf( const xbString & Date8 ) xbString & CharMonthOf() | Returns Jan - Dec month of year for a given date |
int DateIsValid( const char *Date8 ) const int DateIsValid( const xbString & Date8 ) const | Checks a date for validity, returns true (1) if date is valid |
int DayOf( int Format, const char *Date8 ) const int DayOf( int Format, const xbString &Date8 ) const int DayOf( int Format ) const | Returns day of WEEK, MONTH or YEAR from a given date where Format is one of XB_FMT_WEEK => Number of day in week 0-6 (sun-Sat) XB_FMT_MONTH => Number of day in month 1-31 XB_FMT_YEAR => Number of day in year 1-366 |
xbString & Formatdate( const char * Format, const char * Date8 ) xbString & FormatDate( const xbString & Format, const char * Date8 ) xbString & FormatDate( const char * Format, const xbString & Date8 ) xbString & FormatDate( const xbString & Format, const xbString & Date8 ) xbString & FormatDate( const xbString & Format ) xbString & FormatDate( const char * ) | Return a formatted date. Format - A format specifier with the following paramaters: 1) YYDDD - A julian date format 2) YY or YYYY will print a 2 or 4 digit year 3) M,MM,MMM or MMMM M - one digit month if no leading zero MM - two digit month, contains leading zero MMM - Jan through Dec MMMM - January through December 4) D,DD,DDD or DDDD D - one digit dayif no leading zero DD - two digit day, contains leading zero DDD - Sun through Sat (or julian if YYDDD) DDDD - Sunday through Saturday |
const xbString & GetDate() const xbString & GetDate() | Return date |
const xbString & GetFormattedDate() const xbString & GetFormattedDate() | Returns formatted date. See notes on format paramaters. |
int IsLeapYear( const char *Date8 ) const int IsLeapYear( const xbString &Date8 ) const int IsLeapYear() const | Returns true if given date is a leap year |
long JulianDays( const char *Date8 ) const long JulianDays( const xbString & Date8 ) const long JulianDays() const | Returns number of days since 1/1/0100 to given date |
xbString & JulToDate8( long ) | Converts julian based date to CCYYMMDD format. |
xbString & LastdayOfMonth( const char *Date8 ) xbString & LastDayOfMonth( const xbString & Date8 ) xbString & LastDayOfMonth() | Returns the Date8 format of the last day of the month for a given date |
int MonthOf( const char *Date8 ) const int MonthOf( const xbString &Date8) const int MonthOf() const | Returns month of a date |
int SetDate( const char * Date8 ) int SetDate( const xbString & Date8 ) | Sets the xbDate to Date8. Return 1 on success, 0 on error. |
xbString & Sysdate() | This method sets the class date and returns the system date |
int YearOf( const char *Date8 ) const int YearOf( const xbString &Date8 ) const int YearOf() const | Returns century and year of a date |
xbString &operator+=( int ) | += operator |
xbString &operator-=( int ) | -= operator |
xbString &operator++( int ) | ++ operator |
xbString &operator--( int ) | -- operator |
xbString &operator+( int ) | + operator |
xbString &operator-( int ) | - operator |
long operator-( const xbDate & ) const | - operator |
int operator==( const xbDate & ) const | == operator |
int operator!=( const xbDate & ) const | != operator |
int operator<( const xbDate & ) const | < operator |
int operator>( const xbDate & ) const | > operator |
int operator<=( const xbDate & ) const | <= operator |
int operator>=( const xbDate & ) const | >= operator |