API Guides > ConceptRT 3.x
Date Class Reference

Date according to ISO 8601. More...

Detailed Description

Date according to ISO 8601.

See also
IStringConvertible
+ Inheritance diagram for Date:

Public Member Methods

 Date ()
 Default constructor. More...
 
 Date (TimeStamp timeStamp)
 Explicit convertion from TimeStamp More...
 
 Date (const String &text)
 Explicit convertion from String. More...
 
 Date (Int32 year, Month month, Int32 day)
 Default constructor. More...
 
void SetDate (Int32 year, Month month, Int32 day)
 Sets the date. More...
 
void GetDate (Int32 &year, Month &month, Int32 &day)
 Gets the date. More...
 
Int32 GetYear () const
 Gets the year. More...
 
Month GetMonth () const
 Gets the month. More...
 
Int32 GetDay () const
 Gets the day. More...
 
DayOfWeek GetDayOfWeek () const
 Gets the day of week. More...
 
Int32 GetDayOfYear () const
 Gets the day of year. More...
 
WeekNumber GetWeekNumber () const
 Gets the week number. More...
 
bool IsLeapYear () const
 Query if this date is leap year. More...
 
void ConvertFrom (PCChar8 text)
 Convert from. More...
 
void ConvertTo (BaseStaticString &text) const
 Convert to. More...
 
TimeStamp ToTimeStamp () const
 Converts this object to a TimeStamp. More...
 
Dateoperator+= (const TimeSpan &timeSpan)
 Addition assignment operator. More...
 
Dateoperator-= (const TimeSpan &timeSpan)
 Subtraction assignment operator. More...
 

Constructor & Destructor Documentation

Date ( )

Default constructor.

Date ( TimeStamp  timeStamp)
explicit

Explicit convertion from TimeStamp

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

Explicit convertion from String.

Parameters
textThe text containing the Date value. ("2012-03-03")
RT Exceptions:
RT_ERROR_BAD_PARAMETER
Date ( Int32  year,
Month  month,
Int32  day 
)

Default constructor.

Parameters
yearThe year.
monthThe month.
dayThe day.
RT Exceptions:
RT_ERROR_BAD_PARAMETER

Methods Documentation

void ConvertFrom ( PCChar8  text)
virtual

Convert from.

Parameters
textThe text containing the Date value. ("2012-03-03")
RT Exceptions:
RT_ERROR_BAD_PARAMETER

Implements IStringConvertible.

void ConvertTo ( BaseStaticString text) const
virtual

Convert to.

Parameters
text[in,out] The text.

Implements IStringConvertible.

void GetDate ( Int32 year,
Month month,
Int32 day 
)

Gets the date.

Parameters
year[in,out] The year.
month[in,out] The month.
day[in,out] The day.
Int32 GetDay ( ) const

Gets the day.

Returns
The day.
DayOfWeek GetDayOfWeek ( ) const

Gets the day of week.

Returns
The day of week.
Int32 GetDayOfYear ( ) const

Gets the day of year.

Returns
The day of year.
Month GetMonth ( ) const

Gets the month.

Returns
The month.
WeekNumber GetWeekNumber ( ) const

Gets the week number.

Returns
The week number.
Int32 GetYear ( ) const

Gets the year.

Returns
The year.
bool IsLeapYear ( ) const

Query if this date is leap year.

Returns
true if leap year, false if not.
Date& operator+= ( const TimeSpan timeSpan)

Addition assignment operator.

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

Subtraction assignment operator.

Parameters
timeSpanThe time span.
Returns
The result of the operation.
void SetDate ( Int32  year,
Month  month,
Int32  day 
)

Sets the date.

Parameters
yearThe year.
monthThe month.
dayThe day.
RT Exceptions:

RT_ERROR_OUT_OF_ENUM_RANGE

RT_ERROR_BAD_PARAMETER

TimeStamp ToTimeStamp ( ) const

Converts this object to a TimeStamp.

Returns
This object as a TimeStamp.