API Guides > ConceptRT 3.x
DateTime Class Reference

Date and Time together according to ISO 8601.. More...

Detailed Description

Date and Time together according to ISO 8601..

See also
Date, Time
+ Inheritance diagram for DateTime:

Public Member Methods

 DateTime ()
 Default constructor. More...
 
 DateTime (TimeStamp timeStamp)
 Explicit convertion from TimeStamp. More...
 
 DateTime (const String &text)
 Explicit convertion from String. More...
 
 DateTime (Int32 year, Month month, Int32 day, Int32 hour, Int32 minute, Int32 second=0, Int32 millisecond=0, Int32 microsecond=0)
 Default constructor. More...
 
 DateTime (const Date &Date)
 Constructor of DateTime that use a Date. More...
 
 DateTime (const Date &Date, const Time &Time)
 Constructor of DateTime that use a Date and a Time. More...
 
void SetDateTime (Int32 year, Month month, Int32 day, Int32 hour, Int32 minute, Int32 second=0, Int32 millisecond=0, Int32 microsecond=0)
 Sets a date time. More...
 
void GetDateTime (Int32 &year, Month &month, Int32 &day, Int32 &hour, Int32 &minute, Int32 &second, Int32 &millisecond, Int32 &microsecond)
 Gets a date time. More...
 
Int32 GetYear () const
 Gets the year. More...
 
Month GetMonth () const
 Gets the month. More...
 
Int32 GetDay () const
 Gets the day. More...
 
Int32 GetHour () const
 Gets the hour part of DateTime structure. More...
 
Int32 GetMinute () const
 Gets the minute part of DateTime structure. More...
 
Int32 GetSecond () const
 Gets the second part of DateTime structure. More...
 
Int32 GetMillisecond () const
 Gets the millisecond part of DateTime structure. More...
 
Int32 GetMicrosecond () const
 Gets the microsecond part of DateTime structure. More...
 
const Date GetDate () const
 Gets the date. More...
 
const Time GetTime () const
 Gets the time. More...
 
void SetDate (const Date &Date)
 Sets a date. More...
 
void SetTime (const Time &Time)
 Sets a time. More...
 
void ConvertFrom (PCChar8 text)
 Convert from. More...
 
void ConvertTo (BaseStaticString &text) const
 Convert to. More...
 
String ToString (bool useTSeparator) const
 Convert this object into a string representation. More...
 
TimeStamp ToTimeStamp () const
 Converts this object to a TimeSpan. More...
 
DateTimeoperator+= (const TimeSpan &timeSpan)
 Addition assignment operator. More...
 
DateTimeoperator-= (const TimeSpan &timeSpan)
 Subtraction assignment operator. More...
 

Constructor & Destructor Documentation

DateTime ( )

Default constructor.

DateTime ( TimeStamp  timeStamp)
explicit

Explicit convertion from TimeStamp.

Parameters
timeStampThe time stamp.
DateTime ( const String text)
explicit

Explicit convertion from String.

Parameters
textThe text that contains the DateTime value. ("2012-03-03 14:48:59" or "2012-03-03T14:48:59")
RT Exceptions:
RT_ERROR_BAD_PARAMETER
DateTime ( Int32  year,
Month  month,
Int32  day,
Int32  hour,
Int32  minute,
Int32  second = 0,
Int32  millisecond = 0,
Int32  microsecond = 0 
)

Default constructor.

Parameters
yearThe year.
monthThe month.
dayThe day.
hourThe hour.
minuteThe minute.
second(optional) the second.
millisecond(optional) the millisecond.
microsecond(optional) the microsecond.
RT Exceptions:

RT_ERROR_OUT_OF_ENUM_RANGE

RT_ERROR_BAD_PARAMETER

DateTime ( const Date Date)

Constructor of DateTime that use a Date.

Parameters
DateThe date.
DateTime ( const Date Date,
const Time Time 
)

Constructor of DateTime that use a Date and a Time.

Parameters
DateThe date.
TimeThe time.

Methods Documentation

void ConvertFrom ( PCChar8  text)
virtual

Convert from.

Parameters
textThe text that contains the DateTime value. ("2012-03-03 14:48:59" or "2012-03-03T14:48:59")
RT Exceptions:
RT_ERROR_BAD_PARAMETER

Implements IStringConvertible.

void ConvertTo ( BaseStaticString text) const
virtual

Convert to.

Parameters
text[in,out] The text.

Implements IStringConvertible.

const Date GetDate ( ) const

Gets the date.

Returns
The date.
void GetDateTime ( Int32 year,
Month month,
Int32 day,
Int32 hour,
Int32 minute,
Int32 second,
Int32 millisecond,
Int32 microsecond 
)

Gets a date time.

Parameters
year[in,out] The year.
month[in,out] The month.
day[in,out] The day.
hour[in,out] The hour.
minute[in,out] The minute.
second[in,out] (optional) the second.
millisecond[in,out] (optional) the millisecond.
microsecond[in,out] (optional) the microsecond.
Int32 GetDay ( ) const

Gets the day.

Returns
The day.
Int32 GetHour ( ) const

Gets the hour part of DateTime structure.

Returns
The hour.
Int32 GetMicrosecond ( ) const

Gets the microsecond part of DateTime structure.

Returns
The microsecond.
Int32 GetMillisecond ( ) const

Gets the millisecond part of DateTime structure.

Returns
The millisecond.
Int32 GetMinute ( ) const

Gets the minute part of DateTime structure.

Returns
The minute.
Month GetMonth ( ) const

Gets the month.

Returns
The month.
Int32 GetSecond ( ) const

Gets the second part of DateTime structure.

Returns
The second.
const Time GetTime ( ) const

Gets the time.

Returns
The time.
Int32 GetYear ( ) const

Gets the year.

Returns
The year.
DateTime& operator+= ( const TimeSpan timeSpan)

Addition assignment operator.

Parameters
timeSpanThe time span.
Returns
The result of the operation.
DateTime& operator-= ( const TimeSpan timeSpan)

Subtraction assignment operator.

Parameters
timeSpanThe time span.
Returns
The result of the operation.
void SetDate ( const Date Date)

Sets a date.

Parameters
DateThe date.
void SetDateTime ( Int32  year,
Month  month,
Int32  day,
Int32  hour,
Int32  minute,
Int32  second = 0,
Int32  millisecond = 0,
Int32  microsecond = 0 
)

Sets a date time.

Parameters
yearThe year.
monthThe month.
dayThe day.
hourThe hour.
minuteThe minute.
second(optional) the second.
millisecond(optional) the millisecond.
microsecond(optional) the microsecond.
RT Exceptions:

RT_ERROR_OUT_OF_ENUM_RANGE

RT_ERROR_BAD_PARAMETER

void SetTime ( const Time Time)

Sets a time.

Parameters
TimeThe time.
String ToString ( bool  useTSeparator) const

Convert this object into a string representation.

Parameters
useTSeparatorUse 'T' as separator.
Returns
A string representation of this object. ("2012-03-03 14:48:59" or "2012-03- 03T14:48:59")
TimeStamp ToTimeStamp ( ) const

Converts this object to a TimeSpan.

Returns
This DateTime as a TimeStamp.