![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cTimeDouble.h>
Static Public Member Functions | |
static cTimeDouble __stdcall | EncodeSeconds (double s) |
static cTimeDouble __stdcall | EncodeTime (short h, short m, short s, short ms=0) |
static cTimeDouble __stdcall | EncodeDate (short year=0, short month=0, short day=0) |
static cTimeDouble __stdcall | GetTimeFromSec (TIMESEC_t nTimeSec) |
static cTimeDouble __stdcall | GetTimeFromFile (const cTimeFile &ft) |
static cTimeDouble __stdcall | GetTimeFromStr (const GChar_t *pszDateTime, TZ_TYPE nTimeZoneOffset) |
static bool | IsTimeValid (double dTime) |
static cTimeDouble __stdcall | GetTimeNow () |
static cTimeDouble __stdcall | Date () |
static cTimeDouble __stdcall | Time () |
static cString __stdcall | GetTimeSpanStr (double dDays, TIMEUNIT_TYPE eUnitHigh=TIMEUNIT_Day, int iUnitsDesired=2, bool bShortText=false) |
Static Public Attributes | |
static const int | k_nDaysDiffTimeInt = 25569 |
days difference from cTimeDouble (1899) to cTimeInt (1970) bases // similar to linux SECS_1601_TO_1970 ? More... | |
static const double | k_nY2K = 36526.0 |
The static value for y2k = January 1, 2000 in UTC/GMT. More... | |
static const double | k_nY10 = 3650.0 |
The first 10 years are sometimes reserved to act as offsets. More... | |
static const int | k_nZero = 0 |
double cant be used for in-class initializer More... | |
Protected Member Functions | |
bool | InitTimeUnits (const cTimeUnits &rTu) |
void | DecodeDate (cTimeUnits &rTu) const |
Protected Attributes | |
double | m_dateTime |
DATE = days since (midnight, 30 December 1899 GMT), fraction = time of day. More... | |
Friends | |
class | cTimeDoubleTests |
bool | operator< (const cTimeDouble &dt1, const cTimeDouble &dt2) |
bool | operator<= (const cTimeDouble &dt1, const cTimeDouble &dt2) |
bool | operator> (const cTimeDouble &dt1, const cTimeDouble &dt2) |
bool | operator>= (const cTimeDouble &dt1, const cTimeDouble &dt2) |
bool | operator== (const cTimeDouble &dt1, const cTimeDouble &dt2) |
bool | operator!= (const cTimeDouble &dt1, const cTimeDouble &dt2) |
same as DATE, COleDateTime same as _WIN32 VariantTimeToSystemTime, same as DATE, COleDateTime Absolute 64 bit double days since (1899/12/30 midnight GMT). double 1.0 = 1 day NOT the same as REFTIME which is (double) seconds.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
like SystemTimeToVariantTime but it ASSUMES GMT m_dateTime = 1 = whole days since 1900
|
static |
Get just whole days portion for now.
|
protected |
|
static |
Encode GMT Date as days since (1899/12/30 midnight GMT) or (1900/1/1 0:0:0 GMT) same as SystemTimeToVariantTime() but more accurate for mSec
|
static |
Encode GMT Time
|
static |
Encode GMT Time Same as MFC COleDateTime::EncodeTime
TIMEDOW_TYPE Gray::cTimeDouble::get_DayOfWeek | ( | void | ) | const |
MFC GetDayOfWeek is +1.
Sunday is 0, TIMEDOW_TYPE MFC does (sun=1) but we don't
|
inline |
Get total days since epoch.
|
inline |
How old is this? (in days) current time - this time.
|
inline |
diff in days
|
inline |
Arbitrary units. same as days.
cTimeFile Gray::cTimeDouble::GetAsFileTime | ( | ) | const |
convert double time to file system time cTimeFile = 64-bit 100-nanosec since January 1, 1601 GMT
|
inline |
< Numeric date of date object
Get Total days as an integer.
cString Gray::cTimeDouble::GetTimeFormStr | ( | const GChar_t * | pszFormat = nullptr , |
TZ_TYPE | nTimeZoneOffset = TZ_LOCAL |
||
) | const |
Get the time as a string formatted using "C" strftime() MFC just calls this "Format"
|
inline |
|
static |
cTimeFile = 64-bit 100-nanosec since January 1, 1601 GMT double = days since (midnight, 30 December 1899 GMT)
|
static |
convert TIMESEC_t (seconds) to double (days) Opposite of cTimeInt::GetTimeFromDays()
|
inlinestatic |
|
static |
cTimeFile = 64-bit 100-nanosec since January 1, 1601 GMT/UTC
|
static |
Describe a delta/span of time from days to milliseconds. iUnitHigh = 0 = days.
bool Gray::cTimeDouble::GetTimeUnits | ( | OUT cTimeUnits & | rTu, |
TZ_TYPE | nTimeZoneOffset | ||
) | const |
Convert to cTimeUnits as TZ_UTC = TZ_GMT = NOT localized system time. Number of days since Dec. 30, 1899 VariantTimeToSystemTime
|
inline |
< dTime = 0 = clear to invalid time.
void Gray::cTimeDouble::InitTimeNow | ( | ) |
|
protected |
|
inline |
|
inlinestatic |
|
inline |
Get total days since epoch.
|
inline |
|
inline |
Add days.
|
inline |
|
inline |
|
inline |
|
inline |
Add days.
idays | days |
|
inline |
|
inline |
Subtract days.
|
inline |
|
inline |
|
inline |
|
inline |
Subtract days.
idays | days |
|
inline |
|
inline |
HRESULT Gray::cTimeDouble::SetTimeStr | ( | const GChar_t * | pszDateTime, |
TZ_TYPE | nTimeZoneOffset = TZ_UTC |
||
) |
Set the time/date from a string date time . Attempt to determine format from the string/numbers given.
|
static |
Time of day now = 0 to 1
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
days difference from cTimeDouble (1899) to cTimeInt (1970) bases // similar to linux SECS_1601_TO_1970 ?
|
static |
The first 10 years are sometimes reserved to act as offsets.
|
static |
The static value for y2k = January 1, 2000 in UTC/GMT.
|
static |
double cant be used for in-class initializer
|
protected |
DATE = days since (midnight, 30 December 1899 GMT), fraction = time of day.