Class Hierarchy   Class Index   Method Index  

CHMdateTime Class Reference

#include <CHMdateTimeClass.h>


Detailed Description

Date/Time class.

This class provides convenient methods to access members of date/time columns in Chameleon tables.


Public Member Functions

 CHMdateTime ()
 Default constructor.
 CHMdateTime (time_t Time)
 Construct a date/time object from a time_t value.
 CHMdateTime (CHMdateTimeHandle Handle)
 Constructor used in the internal implementation of Chameleon to construct a date/time object from a handle to the underlying Chameleon date/time object.
 CHMdateTime (const CHMdateTime &Orig)
 Copy constructor.
virtual ~CHMdateTime ()
 Destructor.
CHMdateTimeoperator= (time_t Time)
 Set the date/time to the value denoted by time_t quantity Time.
CHMdateTimeoperator= (const CHMdateTime &Orig)
 Assignment operator.
DATE Date () const
 Get a floating point quantity that measures the number of days from midnight (12AM) 30 December 1899.
const CHMdateTimeHandle DateTimeHandle () const
 Get the handle for the underlying date/time object.
int Day () const
 Get the day of the month.
int DayOfWeek () const
 Get the day of the week as an integer.
int DayOfYear () const
 Get the day of the year.
CHMstring Dump () const
 Output the current date/time to a string in the format Day/Month/Year Hour:Minute:Second (Time Zone).
int Hour () const
 Get the hour of the day.
CHMboolean IsNull () const
 Check if this date/time is null.
int Minute () const
 Get the minute of the hour.
int Month () const
 Get the month as an integer.
int Second () const
 Get the second of the minute.
double SecondFraction () const
 Get the fractional number of seconds.
CHMboolean SetDate (int nYear, int nMonth, int nDay)
 Set the date to nYear/nMonth/nDay.
void SetDate (DATE NewValue)
 Set the DATE to NewValue.
CHMboolean SetDateTime (int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec)
 Set the date to nYear/nMonth/nDay, and the time to nHour:nMin:nSec.
void setNull ()
 Set this date/time to null.
void SetSecondFraction (double Value)
 Set the fractional number of seconds to Value.
CHMboolean SetTime (int nHour, int nMin, int nSec)
 Set the time to nHour:nMin:nSec.
void SetZone (short Value)
 Set the time zone with the short integer Value.
int Year () const
 Get the year.
short Zone () const
 Get a short integer indicating the time zone.

Static Public Member Functions

static CHMdateTime Now ()
 Get the current date/time.


Constructor & Destructor Documentation

CHMdateTime::CHMdateTime  ) 
 

Default constructor.

CHMdateTime::CHMdateTime time_t  Time  ) 
 

Construct a date/time object from a time_t value.

CHMdateTime::CHMdateTime CHMdateTimeHandle  Handle  )  [explicit]
 

Constructor used in the internal implementation of Chameleon to construct a date/time object from a handle to the underlying Chameleon date/time object.

This should not be called.

CHMdateTime::CHMdateTime const CHMdateTime Orig  ) 
 

Copy constructor.

virtual CHMdateTime::~CHMdateTime  )  [virtual]
 

Destructor.


Member Function Documentation

DATE CHMdateTime::Date  )  const
 

Get a floating point quantity that measures the number of days from midnight (12AM) 30 December 1899.

For example, 6AM 1 January 1900 is represented as 2.25. Hours and minutes are represented as fractional days, i.e., 0.25 * 24 hours = 6AM. OLE DATE quantity.

const CHMdateTimeHandle CHMdateTime::DateTimeHandle  )  const
 

Get the handle for the underlying date/time object.

This is part of the internal implementation of Chameleon and should not be called.

int CHMdateTime::Day  )  const
 

Get the day of the month.

The range of possible return values is [1..31].

int CHMdateTime::DayOfWeek  )  const
 

Get the day of the week as an integer.

The range of possible return values is [1..7] where 1=Sun, 2=Mon, etc.

int CHMdateTime::DayOfYear  )  const
 

Get the day of the year.

The range of possible return values is [1..365] where Jan 1st = 1, etc.

CHMstring CHMdateTime::Dump  )  const
 

Output the current date/time to a string in the format Day/Month/Year Hour:Minute:Second (Time Zone).

For example, February 28, 1977 12:34pm EST would be output as 28/02/1977 12:34:00 (zone -5).

int CHMdateTime::Hour  )  const
 

Get the hour of the day.

The range of possible return values is [0..23].

CHMboolean CHMdateTime::IsNull  )  const
 

Check if this date/time is null.

This is very useful for determining whether or not a date/time is present in a message.

int CHMdateTime::Minute  )  const
 

Get the minute of the hour.

The range of possible return values is [0..59].

int CHMdateTime::Month  )  const
 

Get the month as an integer.

The range of possible return values is [1..12] where January = 1, February = 2, etc.

static CHMdateTime CHMdateTime::Now  )  [static]
 

Get the current date/time.

Static operator.

CHMdateTime& CHMdateTime::operator= const CHMdateTime Orig  ) 
 

Assignment operator.

CHMdateTime& CHMdateTime::operator= time_t  Time  ) 
 

Set the date/time to the value denoted by time_t quantity Time.

Returns the resulting date/time object.

int CHMdateTime::Second  )  const
 

Get the second of the minute.

The range of possible return values is [0..59].

double CHMdateTime::SecondFraction  )  const
 

Get the fractional number of seconds.

void CHMdateTime::SetDate DATE  NewValue  ) 
 

Set the DATE to NewValue.

See Date() for an explanation of the format of a DATE type.

CHMboolean CHMdateTime::SetDate int  nYear,
int  nMonth,
int  nDay
 

Set the date to nYear/nMonth/nDay.

Returns true if the date is valid.

CHMboolean CHMdateTime::SetDateTime int  nYear,
int  nMonth,
int  nDay,
int  nHour,
int  nMin,
int  nSec
 

Set the date to nYear/nMonth/nDay, and the time to nHour:nMin:nSec.

Returns true if the date/time is valid.

void CHMdateTime::setNull  ) 
 

Set this date/time to null.

void CHMdateTime::SetSecondFraction double  Value  ) 
 

Set the fractional number of seconds to Value.

CHMboolean CHMdateTime::SetTime int  nHour,
int  nMin,
int  nSec
 

Set the time to nHour:nMin:nSec.

Returns true if the time is valid.

void CHMdateTime::SetZone short  Value  ) 
 

Set the time zone with the short integer Value.

int CHMdateTime::Year  )  const
 

Get the year.

short CHMdateTime::Zone  )  const
 

Get a short integer indicating the time zone.


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