ccTime

09/16/99

Author: Daniel.Lindh@Home.se
ICQ: 7983755
HOMEPAGE: home.bip.net/CyberCow

Copyright © Cyber Cow 1995 - 1999.
All Rights Reserved.

OverView
Class Members
Base Class CGoodTime

 

Overview

#include <ccTime.h>

Hierarchy Chart

 


This is a year 2038 safe time class derivied from the dito safe class CGoodTime. This class has an exctended interface, which handles assigning date and time formated strings.

 

Class Members

Construction

Public:

ccTime

Constructor

Input/Output

Public:

setDate

Set the objects Date "yyyy-mm-dd".

getDate

Get the objects Date "yyyy-mm-dd".

setTime

Set the objects Time "hh:mm:ss"

getTime

Get the objects Time "hh:mm:ss"

setDateTime

Set the objects Date and Time "yyyy-mm-dd hh:mm:ss"

getDateTime

Get the objects Date and Time "yyyy-mm-dd hh:mm:ss"

 

 

ccEdit::ccEdit

ccTime();

ccTime( CString lsDataBaseDateTime );

Return Value:

None

Arguments:

lsDataBaseDateTime

The new object will be assigned with this date and time. For more info see setDateTime.

Remarks:

Create the ccTime object.

Example:

ccTime oTime1;

ccTime oTime2( "1990-12-30 12:00:14" );

 

ccEdit::setDate

void setDate( int aiYear, int aiMonth, int aiDay );
void setDate( CString asDate );

Return Value:

None

Arguments:

aiYear

The year can be in range from 1901-9999

aiMonth

The month.

aiDay

The day.

asDate

The date in the string format "yyyy-mm-dd"

Remarks:

Set the ccTime objects date. The time in the object will be set to "00:00:00". If a date in the argument are to high or low it will be validated to a valid date.  

Example:

ccTime oTime;

oTime.setDate( 2210, 12, 24 );

oTime.setDate( "2210-12-24" );

 

ccEdit::getDate

CString getDate();

Return Value:

CString

Will return the date in the ccTime object in the format "yyyy-mm-dd"

Arguments:

None

Remarks:

Return the date in the ccTime object.

Example:

ccTime oTime;

oTime.setDate( 2210, 12, 24 );

CString lsDate = oTime.getDate();

 

ccEdit::setTime

void setTime( int aiHour, int aiMin, int aiSec );
void setTime( CString asTime );

Return Value:

None

Arguments:

aiHour

The hour in range from 0-23.

aiMin

The minute

aiSec

The second

asTime

The time in  the string format "hh-mm-ss"

Remarks:

Set the ccTime objects time. The date in the object will be set to "1901:01:01". If a time in the argument are to high or low it will be validated to a valid date.  

Example:

ccTime oTime;

oTime.setTime( 14, 59, 59 );

oTime.setTime( "14:59:59" );

 

ccEdit::getTime

CString getTime();

Return Value:

CString

Will return the time in the ccTime object in the format "hh:mm;ss"

Arguments:

None

Remarks:

Return the time in the ccTime object.

Example:

ccTime oTime;

oTime.setTime( 4, 44, 00 );

CString lsTime = oTime.getTime();

 

ccEdit::setDateTime

void setDateTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec);
void setDateTime( CString asDateTime );

Return Value:

None

Arguments:

aiYear

The year can be in range from 1901-9999

aiMonth

The month.

aiDay

The day.

aiHour

The hour in range from 0-23.

aiMin

The minute

aiSec

The second

asDateTime

The date and time in the string format "yyyy-mm-dd hh-mm-ss"

Remarks:

Set the ccTime objects date and time. If a date or time in the argument are to high or low it will be validated to a valid date and time.  

Example:

ccTime oTime;

oTime.setDateTime( 2001, 12, 24, 12, 43, 44 );

oTime.setDateTime( "2001-12-24 12:43:44" );

 

ccEdit::getDateTime

**constructor();**

Return Value:

None

Will return the date and time in the ccTime object in the format "yyyy-mm-dd hh-mm-ss"

Arguments:

None

Remarks:

Return the date and time in the ccTime object.

Example:

ccTime oTime;

oTime.setDateTime( 2001, 12, 24, 12, 43, 44 );

CString lsDateTime = oTime.GetDateTime();