Rogue Wave Views
Data Access Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Friends
IliDate Class Reference

User interface class. More...

#include <ilviews/dataccess/date.h>

Public Member Functions

 IliDate ()
 This constructor creates an IliDate object corresponding to 0h00 on 1st January 1901.
 
 IliDate (IlInt y, IlInt mo, IlInt d, IlInt h=0, IlInt m=0, IlInt s=0)
 This constructor creates a date object where the date is provided by the parameters. More...
 
 IliDate (const IliDate &)
 This is the copy constructor of class IliDate.
 
IlInt getFirstYearDayOfMonth () const
 Returns the day of the year of the first day in the month of the date object. More...
 
IlInt getHour () const
 Returns the hour of the time part of the date object as an integer between 0 and 23. More...
 
IlInt getMilliseconds () const
 Returns the milliseconds of the date object as an integer between 0 and 999. More...
 
IlInt getMinutes () const
 Returns the minutes of the time part of a date object as an integer between 0 and 59. More...
 
IlInt getMonth () const
 Returns the month part of the date as an integer between 1 and 12. More...
 
IlInt getMonthDay () const
 Returns the month day of the date object as an integer between 1 and 31. More...
 
IlInt getMonthDaysCount () const
 Returns the number of days that occur in the month of the date object. More...
 
IlInt getQuarter () const
 Returns the quarter of the date object as an integer between 1 and 4. More...
 
IlInt getSeconds () const
 Returns the seconds of the time part of a date object as an integer between 0 and 59. More...
 
IlInt getWeekDay () const
 Returns the day of the week of the date object as an integer between 1 and 7. More...
 
IlInt getYear () const
 Returns the year part of the date (for example, 1996). More...
 
IlInt getYearDay () const
 Returns the day of the year of the date object as an integer value between 1 and 366. More...
 
IlInt getYearWeek () const
 Returns the week of the year of the date object as an integer between 1 and 53. More...
 
IlBoolean hasTime () const
 Returns IlTrue if the time part of the date object differs from 0h00.
 
IlBoolean isDayValid () const
 Returns IlFalse if the day of the month part of the date object is not a valid day, according to the month and year. More...
 
IlBoolean isLeap () const
 Returns IlTrue if the year is a leap year. More...
 
IlBoolean isLeapYear () const
 Returns IlTrue if the year is a leap year. More...
 
 operator struct tm () const
 Returns a struct tm describing the same date as this object. More...
 
int operator!= (const IliDate &d) const
 Compares two IliDate objects. More...
 
int operator< (const IliDate &d) const
 Compares two IliDate objects. More...
 
int operator<= (const IliDate &d) const
 Compares two IliDate objects. More...
 
IliDateoperator= (const struct tm &t)
 Assigns this IliDate object from a struct tm. More...
 
IliDateoperator= (const IliDate &d)
 This operator lets you copy one date format into another date. More...
 
int operator== (const IliDate &d) const
 Compares two IliDate objects. More...
 
int operator> (const IliDate &d) const
 Compares two IliDate objects. More...
 
int operator>= (const IliDate &d) const
 Compares two IliDate objects. More...
 
IlInt operator[] (IliDateInfo ndx) const
 Returns the desired information. More...
 
void read (std::istream &input)
 Reads a date object from an input stream. More...
 
void setHour (IlInt h)
 Sets the hour of a date object. More...
 
void setMilliseconds (IlInt ms)
 Sets the milliseconds of a date object. More...
 
void setMinutes (IlInt m)
 Sets the minutes of a date object. More...
 
void setMonth (IlInt m)
 Sets the month part of a date object. More...
 
void setMonthDay (IlInt md)
 Sets the day of the month of the date object. More...
 
void setSeconds (IlInt s)
 Sets the seconds of a date object. More...
 
void setYear (IlInt y)
 Sets the year part of the date. More...
 
void write (std::ostream &output) const
 Writes a date object to an output stream in a format that allows the date to be read back by the read() member function. More...
 

Friends

class IliTime
 

Detailed Description

User interface class.

Library: dataccess

The IliDate class is used to hold date and time information. This information may be represented by mm/dd/yyyy hh:mm:ss. This class can manage the milliseconds, however some databases does not support the milliseconds.

See also
IliFormat

Constructor & Destructor Documentation

IliDate::IliDate ( IlInt  y,
IlInt  mo,
IlInt  d,
IlInt  h = 0,
IlInt  m = 0,
IlInt  s = 0 
)

This constructor creates a date object where the date is provided by the parameters.

Parameters
yThe year.
moThe month.
dThe day.
hThe hours.
mThe minutes.
sThe seconds.

Member Function Documentation

IlInt IliDate::getFirstYearDayOfMonth ( ) const

Returns the day of the year of the first day in the month of the date object.

The day of the year is a number between 1 and 366.

Returns
The day.
IlInt IliDate::getHour ( ) const

Returns the hour of the time part of the date object as an integer between 0 and 23.

Returns
The hour.
IlInt IliDate::getMilliseconds ( ) const

Returns the milliseconds of the date object as an integer between 0 and 999.

Returns
The milliseconds.
IlInt IliDate::getMinutes ( ) const

Returns the minutes of the time part of a date object as an integer between 0 and 59.

Returns
The minutes.
IlInt IliDate::getMonth ( ) const

Returns the month part of the date as an integer between 1 and 12.

Returns
The month.
IlInt IliDate::getMonthDay ( ) const

Returns the month day of the date object as an integer between 1 and 31.

Returns
The month day.
IlInt IliDate::getMonthDaysCount ( ) const

Returns the number of days that occur in the month of the date object.

This member function takes the year into account.

Returns
The number of days.
IlInt IliDate::getQuarter ( ) const

Returns the quarter of the date object as an integer between 1 and 4.

Returns
The quarter.
IlInt IliDate::getSeconds ( ) const

Returns the seconds of the time part of a date object as an integer between 0 and 59.

Returns
The seconds.
IlInt IliDate::getWeekDay ( ) const

Returns the day of the week of the date object as an integer between 1 and 7.

Returns
The week day.
IlInt IliDate::getYear ( ) const

Returns the year part of the date (for example, 1996).

Returns
The year.
IlInt IliDate::getYearDay ( ) const

Returns the day of the year of the date object as an integer value between 1 and 366.

Returns
The day.
IlInt IliDate::getYearWeek ( ) const

Returns the week of the year of the date object as an integer between 1 and 53.

Returns
The week.
IlBoolean IliDate::isDayValid ( ) const

Returns IlFalse if the day of the month part of the date object is not a valid day, according to the month and year.

Returns
IlTrue if the day is valid.
IlBoolean IliDate::isLeap ( ) const

Returns IlTrue if the year is a leap year.

OBSOLETE Function, you should use the isLeapYear function.

Returns
IlTrue if the year is a leap year.
IlBoolean IliDate::isLeapYear ( ) const

Returns IlTrue if the year is a leap year.

Returns
The leap flag.
IliDate::operator struct tm ( ) const

Returns a struct tm describing the same date as this object.

Note that:

  • The month index starts from 0 in struct tm whereas it starts from 1 in an IliDate object.
  • The year is counted from year 1900 in a struct tm.
Returns
A struct tm object.
int IliDate::operator!= ( const IliDate d) const

Compares two IliDate objects.

Parameters
dThe second date.
Returns
1 if the first date is not equal to the second date, otherwise returns 0.
int IliDate::operator< ( const IliDate d) const

Compares two IliDate objects.

Parameters
dThe second date.
Returns
1 if the first date is smaller than the second date, otherwise returns 0.
int IliDate::operator<= ( const IliDate d) const

Compares two IliDate objects.

Parameters
dThe second date.
Returns
1 if the first date is equal or smaller than the second date, otherwise returns 0.
IliDate& IliDate::operator= ( const struct tm &  t)

Assigns this IliDate object from a struct tm.

Parameters
tThe new values.
Returns
The modified object.
IliDate& IliDate::operator= ( const IliDate d)

This operator lets you copy one date format into another date.

Parameters
dThe new value.
Returns
The modified object.
int IliDate::operator== ( const IliDate d) const

Compares two IliDate objects.

Parameters
dThe second date.
Returns
1 if the first date is equal to the second date, otherwise returns 0.
int IliDate::operator> ( const IliDate d) const

Compares two IliDate objects.

Parameters
dThe second date.
Returns
1 if the first date is bigger than the second date, otherwise returns 0.
int IliDate::operator>= ( const IliDate d) const

Compares two IliDate objects.

Parameters
dThe second date.
Returns
1 if the first date is equal or bigger than the second date, otherwise returns 0.
IlInt IliDate::operator[] ( IliDateInfo  ndx) const

Returns the desired information.

Parameters
ndxThe information index.
Returns
The desired information or -1.
void IliDate::read ( std::istream &  input)

Reads a date object from an input stream.

Parameters
inputThe input stream.
void IliDate::setHour ( IlInt  h)

Sets the hour of a date object.

Parameters
hThe hours (an integer between 0 and 23).
void IliDate::setMilliseconds ( IlInt  ms)

Sets the milliseconds of a date object.

Parameters
msThe milliseconds (an integer between 0 and 999).
void IliDate::setMinutes ( IlInt  m)

Sets the minutes of a date object.

Parameters
mThe minutes (an integer between 0 and 59).
void IliDate::setMonth ( IlInt  m)

Sets the month part of a date object.

Parameters
mThe month (an integer between 1 and 12).
void IliDate::setMonthDay ( IlInt  md)

Sets the day of the month of the date object.

Parameters
mdThe month day (an integer between 1 and 31).
void IliDate::setSeconds ( IlInt  s)

Sets the seconds of a date object.

Parameters
sThe seconds (an integer between 0 and 59).
void IliDate::setYear ( IlInt  y)

Sets the year part of the date.

Parameters
yThe year.
void IliDate::write ( std::ostream &  output) const

Writes a date object to an output stream in a format that allows the date to be read back by the read() member function.

Parameters
outputThe output stream.

© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.