rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliDate Class Reference

User interface class. More...

#include <ilviews/dataccess/date.h>

List of all members.

Public Member Functions

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

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:
y The year.
mo The month.
d The day.
h The hours.
m The minutes.
s The 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:
d The 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:
d The 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:
d The second date.
Returns:
1 if the first date is equal or smaller than the second date, otherwise returns 0.
IliDate& IliDate::operator= ( const IliDate d  ) 

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

Parameters:
d The new value.
Returns:
The modified object.
IliDate& IliDate::operator= ( const struct tm &  t  ) 

Assigns this IliDate object from a struct tm.

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

Compares two IliDate objects.

Parameters:
d The 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:
d The 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:
d The 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:
ndx The information index.
Returns:
The desired information or -1.
void IliDate::read ( IL_STDPREF istream &  input  ) 

Reads a date object from an input stream.

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

Sets the hour of a date object.

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

Sets the milliseconds of a date object.

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

Sets the minutes of a date object.

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

Sets the month part of a date object.

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

Sets the day of the month of the date object.

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

Sets the seconds of a date object.

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

Sets the year part of the date.

Parameters:
y The year.
void IliDate::write ( IL_STDPREF 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:
output The output stream.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright 2012, 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.