7 #ifndef _DATE_TIME_CLASS_HEADER_
8 #define _DATE_TIME_CLASS_HEADER_
707 cString Format(const cString& strFormat) const;
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
tInt64 tTimeStamp
type definition for a time value.
void tVoid
The tVoid is always the definition for the void (non-type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
cDate(const cDate &oDate)
Copy constructor.
tVoid Set(const cDate &oDate)
Sets the stored date.
cString Format(const cString &strFormat) const
Creates a string representation of the stored date.
tBool Valid()
Check whether or not the stored date is valid.
static tInt64 DateDiff(const cString &str, const cString &strDate1, const cString &strDate2)
Calculates the difference between two date strings.
tInt GetYear() const
Get the year.
static cDate GetCurrentSystemDate()
Retrieves the current system date (in UTC format).
static cDate GetCurrentDate()
Retrieves the current date (hardware clock with respect to timezone).
tInt GetDay() const
Get the day of the month.
cDate(const tDate *psDate)
Constructor that presets the stored date from a given data structure.
static tResult GetDateFromString(cDate &oDate, const cString &strDate)
Converts a given date string into a date and fill the given date.
virtual ~cDate()
Destructor.
tInt GetMonth() const
Get the month.
cDate(tInt nYear, tInt nMonth, tInt nDay)
Constructor for presetting the stored date.
tDate m_sDate
Internally used date structure.
static tInt GetNumOfDaysInMonth(const tInt nMonth, const tInt nYear)
Get the number of days of the given month and year (also consider the leap years).
tVoid SetDay(tInt nDay)
Sets the day of the month.
tVoid Set(const tDate *psDate)
Sets the stored date.
tVoid SetMonth(tInt nMonth)
Set the month.
tVoid Set(tInt nYear, tInt nMonth, tInt nDay)
Sets the stored date.
static tBool IsLeapYear(tInt nYear)
Check whether or not the specified year is a leap year.
tBool IsLeapYear() const
Check whether or not the stored year is a leap year.
tVoid Get(tDate *psDate) const
Fills a date structure with the stored values.
cDate()
Default constructor.
tVoid SetYear(tInt nYear)
Set the year.
static tInt64 DateDiff(const cString &str, const cDate &oDate1, const cDate &oDate2)
Calculates the difference between two dates.
static cDateTime FromTimeStamp(tTimeStamp tmDateTime)
Set stored data and time to a timestamp.
static cDateTime GetCurrentSystemDateTime()
Get the current date and time (in UTC format).
cDateTime()
Default constructor.
tResult UnFormat(const cString &strFormat, const cString &strDateTime)
converts a given string into a cDateTime.
tVoid Get(tDateTime *psDateTime) const
Fill a data and time structure with stored values.
static cDateTime GetCurrentDateTime()
Get the current date and time (hardware clock with respect to timezone).
virtual ~cDateTime()
Destructor.
cDateTime(const cDateTime &oDateTime)
Constructor for presetting the stored date and time.
cDateTime(const tDateTime *psDateTime)
Constructor for presetting the stored date and time.
tVoid Set(const tDateTime *psDateTime)
Set the stored date and time.
tVoid Set(tInt nYear, tInt nMonth, tInt nDay, tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0)
Set the stored date and time.
static tTimeStamp GetDiff(const cDateTime &dt1, const cDateTime &dt2)
Calculates the difference between two dates in microseconds.
cDateTime(tInt nYear, tInt nMonth, tInt nDay, tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0)
Constructor for presetting the stored date and time.
tVoid Set(const cDateTime &oDateTime)
Set the stored date and time.
tTimeStamp ToTimeStamp() const
Convert stored date and time to a timestamp.
A common result class usable as return value throughout.
tVoid Get(tTime *psTime) const
Fills a time structure with the stored values.
cString Format(const cString &strFormat) const
Creates a string representation of the stored time.
tBool Valid()
Check whether or not the stored time is valid.
tTime m_sTime
Internally used time structure.
static tResult GetTimeFromString(cTime &oTime, const cString &strTime)
Converts a given time string into a time and fill the given time.
tInt GetSecond() const
Get the second.
tInt GetHour() const
Get the hour.
static cTime FromTimeStamp(tTimeStamp tmTime)
Converts a given timestamp into a time.
cTime()
Default constructor.
tVoid Set(tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0)
Sets the stored time.
static tInt TimeDiff(const cString &str, const cString &strTime1, const cString &strTime2)
Calculates the difference between two time strings.
tVoid SetHour(tInt nHour)
Set the hour.
static cTime GetCurrentTime()
Get the current time (hardware clock with respect to timezone).
virtual ~cTime()
Destructor.
tVoid Set(const cTime &oTime)
Sets the stored time.
tInt Microseconds() const
Get the microsecond.
static tInt TimeDiff(const cString &str, const cTime &oTime1, const cTime &oTime2)
Calculates the difference between two times.
cTime(const cTime &oTime)
Copy constructor.
tVoid SetMinute(tInt nMinute)
Set the minute.
tVoid Set(const tTime *psTime)
Sets the stored time.
cTime(const tTime *psTime)
Constructor for presetting the stored time.
tVoid SetMicroseconds(tInt nMicroseconds)
Set the microsecond.
tVoid SetSecond(tInt nSecond)
Set the second.
tInt GetMinute() const
Get the minute.
cTime(tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0)
Constructor for presetting the stored time.
static cTime GetCurrentSystemTime()
Get the current time (in UTC format).
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Date Structure to define dates.
Struct to handle date and time together.
Time Structure to define Time.