|
TrueReality
v0.1.1912
|
#include <DateTime.h>

Classes | |
| class | TimeFormat |
| class | TimeOrigin |
| class | TimeType |
Public Member Functions | |
| DateTime () | |
| The default constructor just zeros. More... | |
| DateTime (const TimeOrigin &initAs) | |
| This constructor takes a TimeOrigin and sets the time accordingly. More... | |
| DateTime (time_t) | |
| Create a DateTime using the c standard time_t struct. More... | |
| DateTime (const struct tm &) | |
| Create a DateTime using the c standard struct tm. More... | |
| DateTime (const DateTime &) | |
| Copy constructor. More... | |
| DateTime & | operator= (const DateTime &) |
| Assignment operator. More... | |
| virtual | ~DateTime () |
| Destructor. More... | |
| void | SetToLocalTime () |
| Changes time to be system local time. More... | |
| void | SetToGMTTime () |
| Changes time to be GMT- or Greenwich Mean Time. More... | |
| void | IncrementClock (double seconds) |
| Increments the clock time by the number of seconds specified. More... | |
| void | AdjustTimeZone (float newGMTOffset) |
| Every date time has a GMT offset. More... | |
| void | GetTime (unsigned &year, unsigned &month, unsigned &day, unsigned &hour, unsigned &min, float &sec) const |
| Gets the time internally stored using unsigned year, month, day, hour, minute, and seconds. More... | |
| void | GetTime (unsigned &year, unsigned &month, unsigned &day, unsigned &hour, unsigned &min, unsigned &sec) const |
| Gets a time. More... | |
| void | GetGMTTime (unsigned &year, unsigned &month, unsigned &day, unsigned &hour, unsigned &min, float &sec) const |
| Gets the time internally stored using unsigned year, month, day, hour, minute, and seconds. More... | |
| void | GetGMTTime (unsigned &year, unsigned &month, unsigned &day, unsigned &hour, unsigned &min, unsigned &sec) const |
| Gets GMT time. More... | |
| void | SetTime (unsigned year, unsigned month, unsigned day, unsigned hour, unsigned min, float sec) |
| Sets the full time using year, month, day, hour, minute, and second. More... | |
| void | SetTime (unsigned year, unsigned month, unsigned day, unsigned hour, unsigned min, unsigned sec) |
| Sets a time. More... | |
| time_t | GetTime () const |
| Gets the time in the standard time_t format, specified as seconds elapsed since midnight, January 1, 1970. More... | |
| time_t | GetGMTTime () const |
| Gets the time in standard time_t format, the GMTOffset is added to the time before calculating time_t. More... | |
| void | SetTime (time_t) |
| Sets time in standard time_t format, specified as seconds elapsed since midnight, January 1, 1970. More... | |
| double | GetTimeInSeconds () const |
| Returns the total clock time in seconds elapsed since midnight, January 1, 1970 This time includes fractional seconds. More... | |
| void | GetTime (tm &) const |
| Fills a standard c struct tm with the time. More... | |
| void | GetGMTTime (tm &) const |
| Fills a standard c struct tm with the time but adds GMTOffset into time before struct tm is calculated. More... | |
| void | SetTime (const tm &) |
| Sets the time using the standard c struct tm. More... | |
| void | SetGMTOffset (float hourOffset, bool dayLightSavings) |
| Sets the GMTOffset which is added to the time when getting GMT time,. More... | |
| void | SetGMTOffset (double lattitude, double longitude, bool dayLightSavings) |
| Calculates the GMTOffset using a lattitude and longitude, not 100% correct due to regional time zone boundaries but it works ok as an approximation. More... | |
| float | GetGMTOffset () const |
| Gets the GMTOffset, this will be 0 unless SetGMTOffset was called or SetToLocalTime() was called, or TimeOrigin::LOCAL_TIME was fed into the constructor. More... | |
| float | GetTimeScale () const |
| The TimeScale can be used to scale the time when incrementing the clock. More... | |
| void | SetTimeScale (float percentScaleInSeconds) |
| The TimeScale can be used to scale the time when incrementing the clock. More... | |
| const TimeType & | GetTimeType () const |
| The TimeType enumeration is used to identify the purpose of a DateTime instance. More... | |
| void | SetTimeType (const TimeType &) |
| The TimeType enumeration is used to identify the purpose of a DateTime instance. More... | |
| const TimeOrigin & | GetTimeOrigin () const |
| The TimeOrigin enumeration determines how the instance of DateTime should be interpreted. More... | |
| void | SetTimeOrigin (const TimeOrigin &) |
| The TimeOrigin enumeration determines how the instance of DateTime should be interpreted. More... | |
| const TimeFormat & | GetTimeFormat () const |
| The TimeFormat enumeration is used to specify how to map a DateTime object to a string. More... | |
| void | SetTimeFormat (const TimeFormat &) |
| The TimeFormat enumeration is used to specify how to map a DateTime object to a string. More... | |
| float | GetSecond () const |
| Gets the second. More... | |
| void | SetSecond (float sec) |
| Sets a second. More... | |
| unsigned | GetMinute () const |
| Gets the minute. More... | |
| void | SetMinute (unsigned min) |
| Sets a minute. More... | |
| unsigned | GetHour () const |
| Gets the hour. More... | |
| void | SetHour (unsigned hour) |
| Sets a hour. More... | |
| unsigned | GetDay () const |
| Gets the day. More... | |
| void | SetDay (unsigned day) |
| Sets a day. More... | |
| unsigned | GetMonth () const |
| Gets the month. More... | |
| void | SetMonth (unsigned month) |
| Sets a month. More... | |
| unsigned | GetYear () const |
| Gets the year. More... | |
| void | SetYear (unsigned year) |
| Sets a year. More... | |
| std::string | ToString () const |
| The no parameter version of ToString uses the internal TimeFormat, see the TimeFormat enumeration above. More... | |
| std::string | ToString (const TimeFormat &) const |
| Converts the time to a string using a TimeFormat enumeration, see the TimeFormat enumeration above. More... | |
| operator time_t () const | |
| general purpose conversion operators. More... | |
| operator tm () const | |
| Cast that converts the given to a tm. More... | |
| operator std::string () const | |
| Cast that converts the given to a string. More... | |
Static Public Member Functions | |
| static float | GetLocalGMTOffset (bool accountForDST=false) |
| Gets local GMT offset. More... | |
| static float | CalcGMTOffset (tm &timeParts, bool factorLocalDayLightSavingsIntoGMTOffset) |
| Sets the GMTOffset using the systems local time this offset is added to the time when getting GMT time,. More... | |
| static std::string | ToString (const DateTime &, const TimeFormat &) |
| A static version of ToString() for convenience, using the conversion operators a time_t or struct tm can be passed for the DateTime. More... | |
Private Member Functions | |
| void | ResetToDefaultValues () |
| Resets to default values. More... | |
Static Private Member Functions | |
| static void | GetGMTTime (time_t *t, tm &timeParts) |
| Gets GMT time. More... | |
| static void | GetLocalTime (time_t *t, tm &timeParts) |
| Gets local time. More... | |
Private Attributes | |
| float | mGMTOffset |
| The GMT offset. More... | |
| float | mTimeScale |
| The time scale. More... | |
| double | mFractionalSeconds |
| The fractional in seconds. More... | |
| unsigned | mSeconds |
| unsigned | mMinutes |
| unsigned | mHours |
| unsigned | mDays |
| unsigned | mMonths |
| unsigned | mYears |
| Store parts of time. More... | |
| const TimeOrigin * | mTimeOrigin |
| The time origin. More... | |
| const TimeType * | mTimeType |
| Type of the time. More... | |
| const TimeFormat * | mStringFormat |
| The string format. More... | |
Definition at line 44 of file DateTime.h.
| trUtil::DateTime::DateTime | ( | ) |
The default constructor just zeros.
Definition at line 65 of file DateTime.cpp.
References ResetToDefaultValues().

| trUtil::DateTime::DateTime | ( | const TimeOrigin & | initAs | ) |
This constructor takes a TimeOrigin and sets the time accordingly.
| initAs | The init as. |
Definition at line 71 of file DateTime.cpp.
References trUtil::DateTime::TimeOrigin::GMT_TIME, trUtil::DateTime::TimeOrigin::LOCAL_TIME, mTimeOrigin, ResetToDefaultValues(), SetToGMTTime(), and SetToLocalTime().

| trUtil::DateTime::DateTime | ( | time_t | t | ) |
Create a DateTime using the c standard time_t struct.
| parameter1 | The first parameter. |
Definition at line 87 of file DateTime.cpp.
References ResetToDefaultValues(), and SetTime().

| trUtil::DateTime::DateTime | ( | const struct tm & | t | ) |
Create a DateTime using the c standard struct tm.
| parameter1 | The first parameter. |
Definition at line 94 of file DateTime.cpp.
References ResetToDefaultValues(), and SetTime().

| trUtil::DateTime::DateTime | ( | const DateTime & | rhs | ) |
Copy constructor.
| parameter1 | The first parameter. |
Definition at line 102 of file DateTime.cpp.
|
virtual |
Destructor.
Definition at line 127 of file DateTime.cpp.
| void trUtil::DateTime::AdjustTimeZone | ( | float | newGMTOffset | ) |
Every date time has a GMT offset.
This method allows one to set a new GMT offset, and then change the clock internally to match the newoffset. For example if the clock is in 12:00 AM Eastern Time (-5) Jan 5, 2009, setting the offset to west coast time (-8) would make the date time be 9:00 PM, Jan 4, 2009.
| newGMTOffset | the offset in hours from GMT to change this to. |
Definition at line 196 of file DateTime.cpp.
References IncrementClock(), and mGMTOffset.

|
static |
Sets the GMTOffset using the systems local time this offset is added to the time when getting GMT time,.
| [in,out] | timeParts | the struct tm used to calculate the local timezone. |
| factorLocalDayLightSavingsIntoGMTOffset | this flag is used to specify whether or not daylight savings should be obtained from the system clock, setting true will increment the GMTOffset by one hour if your system is currently on daylight savings. |
Definition at line 401 of file DateTime.cpp.
Referenced by GetLocalGMTOffset(), and SetToLocalTime().

| unsigned trUtil::DateTime::GetDay | ( | ) | const |
| float trUtil::DateTime::GetGMTOffset | ( | ) | const |
Gets the GMTOffset, this will be 0 unless SetGMTOffset was called or SetToLocalTime() was called, or TimeOrigin::LOCAL_TIME was fed into the constructor.
Definition at line 443 of file DateTime.cpp.
References mGMTOffset.
Referenced by ToString().

| void trUtil::DateTime::GetGMTTime | ( | unsigned & | year, |
| unsigned & | month, | ||
| unsigned & | day, | ||
| unsigned & | hour, | ||
| unsigned & | min, | ||
| float & | sec | ||
| ) | const |
Gets the time internally stored using unsigned year, month, day, hour, minute, and seconds.
The float second version will include the sub second time if IncrementClock() or SetSecond() was not rounded off. The GMTOffset will be added into the current time to obtain the GMT Time.
| [in,out] | year | the full year, not just since 1900 epoch. |
| [in,out] | month | the month specified as 1-12. |
| [in,out] | day | the day specified as 1-31. |
| [in,out] | hour | hours since midnight 0-23. |
| [in,out] | min | minutes after the hour 0-60. |
| [in,out] | sec | seconds after the hour 0-61 (and extra second is added to support leap seconds) |
Definition at line 250 of file DateTime.cpp.
References GetGMTTime(), mDays, mHours, mMinutes, mMonths, mSeconds, and mYears.

| void trUtil::DateTime::GetGMTTime | ( | unsigned & | year, |
| unsigned & | month, | ||
| unsigned & | day, | ||
| unsigned & | hour, | ||
| unsigned & | min, | ||
| unsigned & | sec | ||
| ) | const |
Gets GMT time.
| [in,out] | year | The year. |
| [in,out] | month | The month. |
| [in,out] | day | The day. |
| [in,out] | hour | The hour. |
| [in,out] | min | The minimum. |
| [in,out] | sec | The security. |
Definition at line 262 of file DateTime.cpp.
References GetGMTTime(), mDays, mHours, mMinutes, mMonths, mSeconds, and mYears.

| time_t trUtil::DateTime::GetGMTTime | ( | ) | const |
Gets the time in standard time_t format, the GMTOffset is added to the time before calculating time_t.
Definition at line 351 of file DateTime.cpp.
References GetTime(), IncrementClock(), and mGMTOffset.
Referenced by GetGMTTime(), GetTime(), SetTime(), and SetToGMTTime().


| void trUtil::DateTime::GetGMTTime | ( | tm & | timeParts | ) | const |
Fills a standard c struct tm with the time but adds GMTOffset into time before struct tm is calculated.
| [in,out] | parameter1 | The first parameter. |
Definition at line 374 of file DateTime.cpp.
References GetTime(), IncrementClock(), and mGMTOffset.

|
staticprivate |
Gets GMT time.
| [in,out] | t | If non-null, the time_t to process. |
| [in,out] | timeParts | The time parts. |
Definition at line 659 of file DateTime.cpp.
| unsigned trUtil::DateTime::GetHour | ( | ) | const |
|
static |
Gets local GMT offset.
| accountForDST | (Optional) True to account for destination. |
Definition at line 171 of file DateTime.cpp.
References CalcGMTOffset(), and GetLocalTime().

|
staticprivate |
Gets local time.
| [in,out] | t | If non-null, the time_t to process. |
| [in,out] | timeParts | The time parts. |
Definition at line 678 of file DateTime.cpp.
Referenced by GetLocalGMTOffset(), and SetToLocalTime().

| unsigned trUtil::DateTime::GetMinute | ( | ) | const |
Gets the minute.
Definition at line 463 of file DateTime.cpp.
References mMinutes.
| unsigned trUtil::DateTime::GetMonth | ( | ) | const |
Gets the month.
Definition at line 501 of file DateTime.cpp.
References mMonths.
Referenced by trUtil::VersionUtil::GetTodaysVersionDate().

| float trUtil::DateTime::GetSecond | ( | ) | const |
Gets the second.
Definition at line 449 of file DateTime.cpp.
References mFractionalSeconds, and mSeconds.
| void trUtil::DateTime::GetTime | ( | unsigned & | year, |
| unsigned & | month, | ||
| unsigned & | day, | ||
| unsigned & | hour, | ||
| unsigned & | min, | ||
| float & | sec | ||
| ) | const |
Gets the time internally stored using unsigned year, month, day, hour, minute, and seconds.
The float second version will include the sub second time if IncrementClock() or SetSecond() was not rounded off. To get time modified by a GMTOffset use GetGMTTime().
| [in,out] | year | the full year, not just since 1900 epoch. |
| [in,out] | month | the month specified as 1-12. |
| [in,out] | day | the day specified as 1-31. |
| [in,out] | hour | hours since midnight 0-23. |
| [in,out] | min | minutes after the hour 0-60. |
| [in,out] | sec | seconds after the hour 0-61 (and extra second is added to support leap seconds) |
Definition at line 228 of file DateTime.cpp.
References mDays, mHours, mMinutes, mMonths, mSeconds, and mYears.
Referenced by GetGMTTime().

| void trUtil::DateTime::GetTime | ( | unsigned & | year, |
| unsigned & | month, | ||
| unsigned & | day, | ||
| unsigned & | hour, | ||
| unsigned & | min, | ||
| unsigned & | sec | ||
| ) | const |
| time_t trUtil::DateTime::GetTime | ( | ) | const |
Gets the time in the standard time_t format, specified as seconds elapsed since midnight, January 1, 1970.
On many systems it is ambiguous if mktime() assumes the input is in GMT, or local timezone. To address this, a new function called timegm() is appearing. It works exactly like mktime() but explicitely interprets the input as GMT.
timegm() is available and documented under FreeBSD. It is available, but completely undocumented on my current Debian 2.1 distribution.
In the absence of timegm() we have to guess what mktime() might do.
Many older BSD style systems have a mktime() that assumes the input time in GMT. But FreeBSD explicitly states that mktime() assumes local time zone
The mktime() on many SYSV style systems (such as Linux) usually returns its result assuming you have specified the input time in your local timezone. Therefore, in the absence if timegm() you have to go to extra trouble to convert back to GMT.
If you are having problems with incorrectly positioned astronomical bodies, this is a really good place to start looking.
Definition at line 304 of file DateTime.cpp.
References mDays, mHours, mMinutes, mMonths, mSeconds, and mYears.
Referenced by GetGMTTime(), GetTime(), GetTimeInSeconds(), operator time_t(), and operator tm().

| void trUtil::DateTime::GetTime | ( | tm & | timeParts | ) | const |
Fills a standard c struct tm with the time.
| [in,out] | parameter1 | The first parameter. |
Definition at line 367 of file DateTime.cpp.
References GetGMTTime(), and GetTime().

| const DateTime::TimeFormat & trUtil::DateTime::GetTimeFormat | ( | ) | const |
The TimeFormat enumeration is used to specify how to map a DateTime object to a string.
Set the TimeFormat if you would like to use the ToString() without any arguments.
Definition at line 565 of file DateTime.cpp.
References mStringFormat.
| double trUtil::DateTime::GetTimeInSeconds | ( | ) | const |
Returns the total clock time in seconds elapsed since midnight, January 1, 1970 This time includes fractional seconds.
Definition at line 298 of file DateTime.cpp.
References GetTime(), and mFractionalSeconds.

| const DateTime::TimeOrigin & trUtil::DateTime::GetTimeOrigin | ( | ) | const |
The TimeOrigin enumeration determines how the instance of DateTime should be interpreted.
Definition at line 552 of file DateTime.cpp.
References mTimeOrigin.
| float trUtil::DateTime::GetTimeScale | ( | void | ) | const |
The TimeScale can be used to scale the time when incrementing the clock.
The default value for TimeScale is 1.0.
Definition at line 527 of file DateTime.cpp.
References mTimeScale.
| const DateTime::TimeType & trUtil::DateTime::GetTimeType | ( | ) | const |
The TimeType enumeration is used to identify the purpose of a DateTime instance.
Definition at line 540 of file DateTime.cpp.
References mTimeType.
| unsigned trUtil::DateTime::GetYear | ( | ) | const |
Gets the year.
Definition at line 514 of file DateTime.cpp.
References mYears.
Referenced by trUtil::VersionUtil::GetTodaysVersionDate().

| void trUtil::DateTime::IncrementClock | ( | double | seconds | ) |
Increments the clock time by the number of seconds specified.
The fractional part of the time is saved off and added in whole increments to support sub second times but getting time as a time_t or struct tm will not include fractional seconds. To get the fractional seconds use GetTime with a float for seconds or GetSecond().
| seconds | number of seconds to increase the clock by. |
Definition at line 181 of file DateTime.cpp.
References mFractionalSeconds, mTimeScale, and SetTime().
Referenced by AdjustTimeZone(), and GetGMTTime().


| trUtil::DateTime::operator std::string | ( | ) | const |
Cast that converts the given to a string.
Definition at line 165 of file DateTime.cpp.
References ToString().

| trUtil::DateTime::operator time_t | ( | ) | const |
general purpose conversion operators.
Definition at line 151 of file DateTime.cpp.
References GetTime().

| trUtil::DateTime::operator tm | ( | ) | const |
Cast that converts the given to a tm.
Definition at line 157 of file DateTime.cpp.
References GetTime().

Assignment operator.
| parameter1 | The first parameter. |
Definition at line 108 of file DateTime.cpp.
References mDays, mFractionalSeconds, mGMTOffset, mHours, mMinutes, mMonths, mSeconds, mStringFormat, mTimeOrigin, mTimeScale, mTimeType, and mYears.
|
private |
Resets to default values.
Definition at line 133 of file DateTime.cpp.
References trUtil::DateTime::TimeFormat::CALENDAR_DATE_AND_TIME_FORMAT, trUtil::DateTime::TimeOrigin::GMT_TIME, mDays, mFractionalSeconds, mGMTOffset, mHours, mMinutes, mMonths, mSeconds, mStringFormat, mTimeOrigin, mTimeScale, mTimeType, mYears, and trUtil::DateTime::TimeType::TIME_TYPE_OTHER.
Referenced by DateTime().

| void trUtil::DateTime::SetDay | ( | unsigned | day | ) |
| void trUtil::DateTime::SetGMTOffset | ( | float | hourOffset, |
| bool | dayLightSavings | ||
| ) |
Sets the GMTOffset which is added to the time when getting GMT time,.
| hourOffset | the number of hours to offset from GMT Time, the param is a float to support half hour time zones. |
| dayLightSavings | this flag is used to specify whether or not daylight savings is in effect setting this flag to true will add and extra hour to the GMTOffset. |
Definition at line 395 of file DateTime.cpp.
References mGMTOffset.
| void trUtil::DateTime::SetGMTOffset | ( | double | lattitude, |
| double | longitude, | ||
| bool | dayLightSavings | ||
| ) |
Calculates the GMTOffset using a lattitude and longitude, not 100% correct due to regional time zone boundaries but it works ok as an approximation.
| lattitude | the geographical lattitude of origin. |
| longitude | the geographical longitude of origin. |
| dayLightSavings | this flag is used to specify whether or not daylight savings is in effect setting this flag to true will add and extra hour to the GMTOffset. |
Definition at line 430 of file DateTime.cpp.
References mGMTOffset.
| void trUtil::DateTime::SetHour | ( | unsigned | hour | ) |
Sets a hour.
| hour | The hour. |
Definition at line 481 of file DateTime.cpp.
References mHours.
| void trUtil::DateTime::SetMinute | ( | unsigned | min | ) |
Sets a minute.
| min | The minimum. |
Definition at line 469 of file DateTime.cpp.
References mMinutes.
| void trUtil::DateTime::SetMonth | ( | unsigned | month | ) |
Sets a month.
| month | The month. |
Definition at line 507 of file DateTime.cpp.
References mMonths.
| void trUtil::DateTime::SetSecond | ( | float | sec | ) |
Sets a second.
| sec | The security. |
Definition at line 455 of file DateTime.cpp.
References mFractionalSeconds, and mSeconds.
| void trUtil::DateTime::SetTime | ( | unsigned | year, |
| unsigned | month, | ||
| unsigned | day, | ||
| unsigned | hour, | ||
| unsigned | min, | ||
| float | sec | ||
| ) |
Sets the full time using year, month, day, hour, minute, and second.
A float version is provided to support sub second times.
| year | the full year, not just since 1900 epoch. |
| month | the month specified as 1-12. |
| day | the day specified as 1-31. |
| hour | hours since midnight 0-23. |
| min | minutes after the hour 0-60. |
| sec | seconds after the hour 0-61 (and extra second is added to support leap seconds) |
Definition at line 274 of file DateTime.cpp.
References mDays, mFractionalSeconds, mHours, mMinutes, mMonths, mSeconds, and mYears.
Referenced by DateTime(), IncrementClock(), SetTime(), SetToGMTTime(), and SetToLocalTime().

| void trUtil::DateTime::SetTime | ( | unsigned | year, |
| unsigned | month, | ||
| unsigned | day, | ||
| unsigned | hour, | ||
| unsigned | min, | ||
| unsigned | sec | ||
| ) |
Sets a time.
| year | The year. |
| month | The month. |
| day | The day. |
| hour | The hour. |
| min | The minimum. |
| sec | The security. |
Definition at line 286 of file DateTime.cpp.
References mDays, mFractionalSeconds, mHours, mMinutes, mMonths, mSeconds, and mYears.
| void trUtil::DateTime::SetTime | ( | time_t | t | ) |
Sets time in standard time_t format, specified as seconds elapsed since midnight, January 1, 1970.
| parameter1 | The first parameter. |
Definition at line 359 of file DateTime.cpp.
References GetGMTTime(), and SetTime().

| void trUtil::DateTime::SetTime | ( | const tm & | mt | ) |
Sets the time using the standard c struct tm.
| parameter1 | The first parameter. |
Definition at line 382 of file DateTime.cpp.
References mDays, mFractionalSeconds, mHours, mMinutes, mMonths, mSeconds, and mYears.
| void trUtil::DateTime::SetTimeFormat | ( | const TimeFormat & | tf | ) |
The TimeFormat enumeration is used to specify how to map a DateTime object to a string.
Set the TimeFormat if you would like to use the ToString() without any arguments.
| parameter1 | The first parameter. |
Definition at line 571 of file DateTime.cpp.
References mStringFormat.
| void trUtil::DateTime::SetTimeOrigin | ( | const TimeOrigin & | to | ) |
The TimeOrigin enumeration determines how the instance of DateTime should be interpreted.
| parameter1 | The first parameter. |
Definition at line 558 of file DateTime.cpp.
References mTimeOrigin.
| void trUtil::DateTime::SetTimeScale | ( | float | percentScaleInSeconds | ) |
The TimeScale can be used to scale the time when incrementing the clock.
The default value for TimeScale is 1.0.
| percentScaleInSeconds | The percent scale in seconds. |
Definition at line 533 of file DateTime.cpp.
References mTimeScale.
| void trUtil::DateTime::SetTimeType | ( | const TimeType & | tt | ) |
The TimeType enumeration is used to identify the purpose of a DateTime instance.
| parameter1 | The first parameter. |
Definition at line 546 of file DateTime.cpp.
References mTimeType.
| void trUtil::DateTime::SetToGMTTime | ( | ) |
Changes time to be GMT- or Greenwich Mean Time.
Definition at line 216 of file DateTime.cpp.
References GetGMTTime(), mFractionalSeconds, mGMTOffset, and SetTime().
Referenced by DateTime().


| void trUtil::DateTime::SetToLocalTime | ( | ) |
Changes time to be system local time.
Definition at line 205 of file DateTime.cpp.
References CalcGMTOffset(), GetLocalTime(), mFractionalSeconds, mGMTOffset, and SetTime().
Referenced by DateTime(), trUtil::Logging::Log::LogMessage(), and trUtil::Logging::LogWriterFile::TimeTag().


| void trUtil::DateTime::SetYear | ( | unsigned | year | ) |
Sets a year.
| year | The year. |
Definition at line 520 of file DateTime.cpp.
References mYears.
| std::string trUtil::DateTime::ToString | ( | ) | const |
The no parameter version of ToString uses the internal TimeFormat, see the TimeFormat enumeration above.
Definition at line 577 of file DateTime.cpp.
References mStringFormat.
Referenced by trUtil::Logging::LogWriterConsole::LogMessage(), trUtil::Logging::LogWriterFile::LogMessage(), operator std::string(), trUtil::Logging::LogWriterFile::TimeTag(), and ToString().

| std::string trUtil::DateTime::ToString | ( | const TimeFormat & | tf | ) | const |
Converts the time to a string using a TimeFormat enumeration, see the TimeFormat enumeration above.
| parameter1 | The first parameter. |
Definition at line 590 of file DateTime.cpp.
References trUtil::DateTime::TimeFormat::CALENDAR_DATE_AND_TIME_FORMAT, trUtil::DateTime::TimeFormat::CALENDAR_DATE_FORMAT, trUtil::DateTime::TimeFormat::CLOCK_TIME_12_HOUR_FORMAT, trUtil::DateTime::TimeFormat::CLOCK_TIME_24_HOUR_FORMAT, GetGMTOffset(), trUtil::DateTime::TimeFormat::LEXICAL_DATE_FORMAT, trUtil::DateTime::TimeFormat::LOCAL_DATE_AND_TIME_FORMAT, trUtil::DateTime::TimeFormat::LOCAL_DATE_FORMAT, trUtil::DateTime::TimeFormat::ORDINAL_DATE_FORMAT, and trUtil::DateTime::TimeFormat::WEEK_DATE_FORMAT.

|
static |
A static version of ToString() for convenience, using the conversion operators a time_t or struct tm can be passed for the DateTime.
| parameter1 | The first parameter. |
| parameter2 | The second parameter. |
Definition at line 583 of file DateTime.cpp.
References ToString().

|
private |
Definition at line 833 of file DateTime.h.
Referenced by GetDay(), GetGMTTime(), GetTime(), operator=(), ResetToDefaultValues(), SetDay(), and SetTime().
|
private |
The fractional in seconds.
Definition at line 824 of file DateTime.h.
Referenced by GetSecond(), GetTimeInSeconds(), IncrementClock(), operator=(), ResetToDefaultValues(), SetSecond(), SetTime(), SetToGMTTime(), and SetToLocalTime().
|
private |
The GMT offset.
Definition at line 820 of file DateTime.h.
Referenced by AdjustTimeZone(), GetGMTOffset(), GetGMTTime(), operator=(), ResetToDefaultValues(), SetGMTOffset(), SetToGMTTime(), and SetToLocalTime().
|
private |
Definition at line 833 of file DateTime.h.
Referenced by GetGMTTime(), GetHour(), GetTime(), operator=(), ResetToDefaultValues(), SetHour(), and SetTime().
|
private |
Definition at line 833 of file DateTime.h.
Referenced by GetGMTTime(), GetMinute(), GetTime(), operator=(), ResetToDefaultValues(), SetMinute(), and SetTime().
|
private |
Definition at line 833 of file DateTime.h.
Referenced by GetGMTTime(), GetMonth(), GetTime(), operator=(), ResetToDefaultValues(), SetMonth(), and SetTime().
|
private |
Definition at line 833 of file DateTime.h.
Referenced by GetGMTTime(), GetSecond(), GetTime(), operator=(), ResetToDefaultValues(), SetSecond(), and SetTime().
|
private |
The string format.
Definition at line 840 of file DateTime.h.
Referenced by GetTimeFormat(), operator=(), ResetToDefaultValues(), SetTimeFormat(), and ToString().
|
private |
The time origin.
Definition at line 836 of file DateTime.h.
Referenced by DateTime(), GetTimeOrigin(), operator=(), ResetToDefaultValues(), and SetTimeOrigin().
|
private |
The time scale.
Definition at line 822 of file DateTime.h.
Referenced by GetTimeScale(), IncrementClock(), operator=(), ResetToDefaultValues(), and SetTimeScale().
|
private |
Type of the time.
Definition at line 838 of file DateTime.h.
Referenced by GetTimeType(), operator=(), ResetToDefaultValues(), and SetTimeType().
Store parts of time.
Definition at line 833 of file DateTime.h.
Referenced by GetGMTTime(), GetTime(), GetYear(), operator=(), ResetToDefaultValues(), SetTime(), and SetYear().