Defined in file: hzDate.h

A full date and time accurate to microseconds (8 bytes)

Constructors/Detructors

hzXDate*hzXDate(void)
void~hzXDate(void)

Public Methods:

uint32_tAsEpoch(void)Return the time & date as an epoch Arguments: None
uint64_tAsVal(void)Return the day of month part from this hzXDate Arguments: None
voidClear(void)
hzSDateDate(void)Extract the date part of the full dte and time as hzSDate (short form date) instance Arguments: None
uint32_tDay(void)Return the day of month part from this hzXDate Arguments: None
uint32_tDaysInYear(void)Arguments: None
uint32_tDow(void)
uint32_tExcel(void)
uint32_tHour(void)
boolIsNull(void)
boolIsSet(void)
uint32_tMin(void)
uint32_tMonth(void)Return the month part from this hzXDate Arguments: None
uint32_tNoDays(void)
uint32_tNoSecs(void)
uint32_tSec(void)
voidSetByEpoch(uint32_t nEpochTime)Set the date and time components of this hzXDate using the epoch time (number of seconds since midnight , Jan 1 1970) Returns: None
voidSetByEpoch(uint32_t nEpochTime)uint32_t usec, Set the date and time components of this hzXDate using the epoch time (number of seconds since midnight , Jan 1 1970). Also set the number of microseconds Returns: None
hzEcodeSetDate(hzXDate& op)
hzEcodeSetDate(hzSDate& D)
hzEcodeSetDate(uint32_t Y)uint32_t M, uint32_t D, Set the date component of this hzXDate instance by three numeric arguments of Y, M and D
hzEcodeSetDate(uint32_t nDays)Set the date component of this hzXDate instance by number of days since Jan 1 0000
hzEcodeSetDate(uint32_t nDays)uint32_t nSecs, Set the date and time components of this hzXDate as two numeric arguments, the number of days since Jan 1 0000 and the number of seconds since midnight.
hzEcodeSetDate(uint64_t xdVal)Set the date and time components of this hzXDate by a single 64-bit value. This function is provided in order to retrieve dates from repositories in the HadronZoo Database Suite which stores full dates as 64 bit unsigned numbers.
hzEcodeSetDate(const char* cpDateStr)Set the date component of this hzXDate instance by a text string of an acceptable format
hzEcodeSetDateTime(const char* i)Set both the date and time components of this hzXDate instance by a text string of an acceptable format
hzEcodeSetTime(hzTime& T)
hzEcodeSetTime(const char* i)Set the time component of this hzXDate using a string representation of the time. Allowed formats are hh:mm:ss, hh:mm and hhmmss
hzEcodeSetTime(uint32_t h)uint32_t m, uint32_t s, Set the time component of this hzXDate to time supplied as hours, minutes and seconds
hzEcodeSetTime(uint32_t nSecs)Set the time component of this hzXDate to time supplied as number of seconds since midnight
voidSysDateTime(void)Set this hzXDate instance by the system clock Arguments: None Returns: None
hzTimeTime(void)Extract the time part of the full data and time as a hzTime instance Arguments: None
const char*Txt(hzDateFmt eFmt)Write the date and time as per the supplied format. The options are:- 1) As YYYYMMDD 2) As dayname, monthname day year (American) 3) As dayname, day monthname year (International) Pointer to buffer populated with the date in text form. Note: The space required is allocated from the thread scratch pad and must not be deleted by the calling function.
uint32_tYear(void)Return the year part from this hzXDate Arguments: None
voidaltdate(hzInterval unit)int32_t nounits, Alter this hzXDate by a number of units which may be either days, months, years, hours, minutes or seconds Returns: None
voidaltday(int32_t nounits)Advance or retard a hzXDate by a number of days. Returns: None
voidalthour(int32_t nounits)Advance or retard a hzXDate by a number of hours. This will alter the day date if the alteration is sufficient to cross one or more midnight boundaries. Returns: None
voidaltmin(int32_t nounits)Advance or retard a hzXDate by a number of minutes. This will alter the day date if the alteration is sufficient to cross one or more midnight boundaries. Returns: None
voidaltmon(int32_t nounits)Advance or retard a hzXDate by a number of months. Returns: None
voidaltsec(int32_t units)Advance or retard a hzXDate by a number of seconds. This will alter the day date if the alteration is sufficient to cross one or more midnight boundaries. Returns: None
voidaltyear(int32_t nounits)Advance or retard a hzXDate by a number of years. Returns: None
int32_tdatecmp(hzXDate& a)hzXDate& b, Compare two hzXDate instances, A and B. Return 1 if A>B, -1 if A<B and 0 if A and B are equal
uint32_tuSec(void)

Overloaded operators:

const char*operator const char *(void)
booloperator!(void)
booloperator!=(hzXDate& op)Return true if the operand hzXDate is not the same as this
const char*operator*(void)
hzXDate&operator+=(uint32_t nDays)Add to this date the supplied number of days
hzXDate&operator-=(uint32_t nDays)Subtract from this date the supplied number of days
booloperator<(hzXDate& op)Return true if this hzXDate is earlier than the operand
ostream&operator<<(ostream& os)hzXDate& Date,
booloperator<=(hzXDate& op)Return true if this hzXDate is earlier than or the same as the operand
hzXDate&operator=(hzXDate& op)
hzXDate&operator=(hzSDate& op)
hzXDate&operator=(uint64_t xdVal)
hzXDate&operator=(hzString& S)
hzXDate&operator=(const char* s)
booloperator==(hzXDate& op)Return true if the operand hzXDate is the same as this
booloperator>(hzXDate& op)Return true if this hzXDate is later than the operand
booloperator>=(hzXDate& op)Return true if this hzXDate is later than or the same as the operand

Member Variables:

uint32_tm_hourno of hours since midnight 0000/01/01
uint32_tm_usecno of microseconds since start of hour