API Guides > ConceptRT 3.x
TimeSpan Class Reference

Time unit. Resolution is 100 ns. More...

Detailed Description

Time unit. Resolution is 100 ns.

+ Inheritance diagram for TimeSpan:

Public Member Methods

 TimeSpan ()
 Default constructor. More...
 
 TimeSpan (TimeStamp timeStamp)
 Explicit converion from TimeStamp. More...
 
 TimeSpan (const String &text)
 Explicit converion from text. More...
 
 TimeSpan (Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond=0, Int32 microsecond=0)
 Constructor. More...
 
void SetTimeSpan (Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond=0, Int32 microsecond=0)
 Sets a time span. More...
 
void GetTimeSpan (Int32 &day, Int32 &hour, Int32 &minute, Int32 &second, Int32 &millisecond, Int32 &microsecond) const
 Gets a time span. More...
 
Int32 GetDay () const
 Get the day part of the TimeSpan structure. More...
 
Int32 GetHour () const
 Get the hour part of the TimeSpan structure. More...
 
Int32 GetMinute () const
 Get the minute part of the TimeSpan structure. More...
 
Int32 GetSecond () const
 Get the second part of the TimeSpan structure. Not Equivalent to ToSeconds(). More...
 
Int32 GetMillisecond () const
 Get the millisecond part of the TimeSpan structure. Not Equivalent to ToMilliseconds(). More...
 
Int32 GetMicrosecond () const
 Get the microsecond part of the TimeSpan structure. Not Equivalent to ToMicroseconds(). More...
 
void ConvertFrom (PCChar8 text)
 Convert from. More...
 
void ConvertTo (BaseStaticString &text) const
 Convert to. More...
 
TimeStamp ToTimeStamp () const
 Converts this object to a time stamp. More...
 
TimeSpanoperator+= (const TimeSpan &right)
 Addition assignment operator. More...
 
TimeSpanoperator-= (const TimeSpan &right)
 Subtraction assignment operator. More...
 
Int32 ToSeconds () const
 Get the number of seconds of the Timespan value. Not Equivalent to GetSecond(). More...
 
Int32 ToMilliseconds () const
 Get the number of milliseconds of the Timespan value. Not Equivalent to GetMillisecond(). More...
 
Int32 ToMicroseconds () const
 Get the number of microseconds of the Timespan value. Not Equivalent to GetMicrosecond(). More...
 

Constructor & Destructor Documentation

TimeSpan ( )

Default constructor.

TimeSpan ( TimeStamp  timeStamp)
explicit

Explicit converion from TimeStamp.

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

Explicit converion from text.

Parameters
textThe text.
TimeSpan ( Int32  day,
Int32  hour,
Int32  minute,
Int32  second,
Int32  millisecond = 0,
Int32  microsecond = 0 
)

Constructor.

Parameters
dayThe day.
hourThe hour.
minuteThe minute.
secondThe second.
millisecond(optional) the millisecond.
microsecond(optional) the microsecond.

Methods Documentation

void ConvertFrom ( PCChar8  text)
virtual

Convert from.

Parameters
textThe text. TimeSpan text format : "1d4h56m32s3ms67us400ns"
RT Exceptions:
RT_ERROR_BAD_PARAMETER

Implements IStringConvertible.

void ConvertTo ( BaseStaticString text) const
virtual

Convert to.

Parameters
text[in,out] The text.

Implements IStringConvertible.

Int32 GetDay ( ) const

Get the day part of the TimeSpan structure.

Returns
The day.
Int32 GetHour ( ) const

Get the hour part of the TimeSpan structure.

Returns
The hour.
Int32 GetMicrosecond ( ) const

Get the microsecond part of the TimeSpan structure. Not Equivalent to ToMicroseconds().

Returns
The microsecond.
Int32 GetMillisecond ( ) const

Get the millisecond part of the TimeSpan structure. Not Equivalent to ToMilliseconds().

Returns
The millisecond.
Int32 GetMinute ( ) const

Get the minute part of the TimeSpan structure.

Returns
The minute.
Int32 GetSecond ( ) const

Get the second part of the TimeSpan structure. Not Equivalent to ToSeconds().

Returns
The second.
void GetTimeSpan ( Int32 day,
Int32 hour,
Int32 minute,
Int32 second,
Int32 millisecond,
Int32 microsecond 
) const

Gets a time span.

Parameters
day[in,out] The day.
hour[in,out] The hour.
minute[in,out] The minute.
second[in,out] The second.
millisecond[in,out] (optional) the millisecond.
microsecond[in,out] (optional) the microsecond.
TimeSpan& operator+= ( const TimeSpan right)

Addition assignment operator.

Parameters
rightThe right.
Returns
The result of the operation.
TimeSpan& operator-= ( const TimeSpan right)

Subtraction assignment operator.

Parameters
rightThe right.
Returns
The result of the operation.
void SetTimeSpan ( Int32  day,
Int32  hour,
Int32  minute,
Int32  second,
Int32  millisecond = 0,
Int32  microsecond = 0 
)

Sets a time span.

Parameters
dayThe day.
hourThe hour.
minuteThe minute.
secondThe second.
millisecond(optional) the millisecond.
microsecond(optional) the microsecond.
Int32 ToMicroseconds ( ) const

Get the number of microseconds of the Timespan value. Not Equivalent to GetMicrosecond().

Returns
the number of microseconds
Int32 ToMilliseconds ( ) const

Get the number of milliseconds of the Timespan value. Not Equivalent to GetMillisecond().

Returns
the number of milliseconds.
Int32 ToSeconds ( ) const

Get the number of seconds of the Timespan value. Not Equivalent to GetSecond().

Returns
The number of seconds.
TimeStamp ToTimeStamp ( ) const

Converts this object to a time stamp.

Returns
This object as a TimeStamp.