|
| cDateTime () |
| Default constructor.
|
|
| cDateTime (tInt nYear, tInt nMonth, tInt nDay, tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0) |
| Constructor for presetting the stored date and time. More...
|
|
| cDateTime (const tDateTime *psDateTime) |
| Constructor for presetting the stored date and time. More...
|
|
| cDateTime (const cDateTime &oDateTime) |
| Constructor for presetting the stored date and time. More...
|
|
virtual | ~cDateTime () |
| Destructor.
|
|
cDateTime & | operator= (const cDateTime &oDateTime) |
| The cDateTime assignment (=) operator reinitializes an existing cDateTime object with new data. More...
|
|
tVoid | Get (tDateTime *psDateTime) const |
| Fill a data and time structure with stored values. More...
|
|
tVoid | Set (tInt nYear, tInt nMonth, tInt nDay, tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0) |
| Set the stored date and time. More...
|
|
tVoid | Set (const tDateTime *psDateTime) |
| Set the stored date and time. More...
|
|
tVoid | Set (const cDateTime &oDateTime) |
| Set the stored date and time. More...
|
|
tTimeStamp | ToTimeStamp () const |
| Convert stored date and time to a timestamp. More...
|
|
cString | Format (const cString &strFormat) const |
| Format the date/time string. More...
|
|
tResult | UnFormat (const cString &strFormat, const cString &strDateTime) |
| converts a given string into a cDateTime. More...
|
|
| cDate () |
| Default constructor.
|
|
| cDate (tInt nYear, tInt nMonth, tInt nDay) |
| Constructor for presetting the stored date. More...
|
|
| cDate (const tDate *psDate) |
| Constructor that presets the stored date from a given data structure. More...
|
|
| cDate (const cDate &oDate) |
| Copy constructor. More...
|
|
virtual | ~cDate () |
| Destructor.
|
|
cDate & | operator= (const cDate &oDate) |
| The cDate assignment (=) operator reinitializes an existing cDate object with new data. More...
|
|
tVoid | Get (tDate *psDate) const |
| Fills a date structure with the stored values. More...
|
|
tVoid | Set (tInt nYear, tInt nMonth, tInt nDay) |
| Sets the stored date. More...
|
|
tVoid | Set (const tDate *psDate) |
| Sets the stored date. More...
|
|
tVoid | Set (const cDate &oDate) |
| Sets the stored date. More...
|
|
tVoid | SetDay (tInt nDay) |
| Sets the day of the month. More...
|
|
tInt | GetDay () const |
| Get the day of the month. More...
|
|
tVoid | SetMonth (tInt nMonth) |
| Set the month. More...
|
|
tInt | GetMonth () const |
| Get the month. More...
|
|
tVoid | SetYear (tInt nYear) |
| Set the year. More...
|
|
tInt | GetYear () const |
| Get the year. More...
|
|
tBool | IsLeapYear () const |
| Check whether or not the stored year is a leap year. More...
|
|
cString | Format (const cString &strFormat) const |
| Creates a string representation of the stored date. More...
|
|
tBool | Valid () |
| Check whether or not the stored date is valid. More...
|
|
| cTime () |
| Default constructor.
|
|
| cTime (tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0) |
| Constructor for presetting the stored time. More...
|
|
| cTime (const tTime *psTime) |
| Constructor for presetting the stored time. More...
|
|
| cTime (const cTime &oTime) |
| Copy constructor. More...
|
|
cTime & | operator= (const cTime &oTime) |
| The cTime assignment (=) operator reinitializes an existing cTime object with new data. More...
|
|
virtual | ~cTime () |
| Destructor.
|
|
tVoid | Get (tTime *psTime) const |
| Fills a time structure with the stored values. More...
|
|
tVoid | Set (tInt nHour, tInt nMinute, tInt nSecond, tInt nMicroseconds=0) |
| Sets the stored time. More...
|
|
tVoid | Set (const tTime *psTime) |
| Sets the stored time. More...
|
|
tVoid | Set (const cTime &oTime) |
| Sets the stored time. More...
|
|
tVoid | SetHour (tInt nHour) |
| Set the hour. More...
|
|
tInt | GetHour () const |
| Get the hour. More...
|
|
tVoid | SetMinute (tInt nMinute) |
| Set the minute. More...
|
|
tInt | GetMinute () const |
| Get the minute. More...
|
|
tVoid | SetSecond (tInt nSecond) |
| Set the second. More...
|
|
tInt | GetSecond () const |
| Get the second. More...
|
|
tVoid | SetMicroseconds (tInt nMicroseconds) |
| Set the microsecond. More...
|
|
tInt | Microseconds () const |
| Get the microsecond. More...
|
|
cString | Format (const cString &strFormat) const |
| Creates a string representation of the stored time. More...
|
|
tBool | Valid () |
| Check whether or not the stored time is valid. More...
|
|
|
static cDateTime | GetCurrentDateTime () |
| Get the current date and time (hardware clock with respect to timezone). More...
|
|
static cDateTime | GetCurrentSystemDateTime () |
| Get the current date and time (in UTC format). More...
|
|
static cDateTime | FromTimeStamp (tTimeStamp tmDateTime) |
| Set stored data and time to a timestamp. More...
|
|
static tTimeStamp | GetDiff (const cDateTime &dt1, const cDateTime &dt2) |
| Calculates the difference between two dates in microseconds. More...
|
|
static cDate | GetCurrentDate () |
| Retrieves the current date (hardware clock with respect to timezone). More...
|
|
static cDate | GetCurrentSystemDate () |
| Retrieves the current system date (in UTC format). More...
|
|
static tBool | IsLeapYear (tInt nYear) |
| Check whether or not the specified year is a leap year. More...
|
|
static tResult | GetDateFromString (cDate &oDate, const cString &strDate) |
| Converts a given date string into a date and fill the given date. More...
|
|
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). More...
|
|
static tInt64 | DateDiff (const cString &str, const cString &strDate1, const cString &strDate2) |
| Calculates the difference between two date strings. More...
|
|
static tInt64 | DateDiff (const cString &str, const cDate &oDate1, const cDate &oDate2) |
| Calculates the difference between two dates. More...
|
|
static cTime | GetCurrentTime () |
| Get the current time (hardware clock with respect to timezone). More...
|
|
static cTime | GetCurrentSystemTime () |
| Get the current time (in UTC format). More...
|
|
static tResult | GetTimeFromString (cTime &oTime, const cString &strTime) |
| Converts a given time string into a time and fill the given time. More...
|
|
static tInt | TimeDiff (const cString &str, const cString &strTime1, const cString &strTime2) |
| Calculates the difference between two time strings. More...
|
|
static tInt | TimeDiff (const cString &str, const cTime &oTime1, const cTime &oTime2) |
| Calculates the difference between two times. More...
|
|
static cTime | FromTimeStamp (tTimeStamp tmTime) |
| Converts a given timestamp into a time. More...
|
|
Format the date/time string.
Returns a formated string containing date/time information. The format argument consists of one or more codes; as in printf, the formatting codes are preceded by a percent sign ('%'
). Characters that do not begin with %
are copied unchanged.
The formatting codes are listed below:
-
%a
Abbreviated weekday name
-
%A
Full weekday name
-
%b
Abbreviated month name
-
%B
Full month name
-
%c
Date and time representation appropriate for locale
-
%d
Day of month as decimal number (01 31)
-
%H
Hour in 24-hour format (00 23)
-
%I
Hour in 12-hour format (01 12)
-
%j
Day of year as decimal number (001 366)
-
%m
Month as decimal number (01 12)
-
%M
Minute as decimal number (00 59)
-
%p
Current locale's A.M./P.M. indicator for 12-hour clock
-
%S
Second as decimal number (00 59)
-
%U
Week of year as decimal number, with Sunday as first day of week (00 53)
-
%w
Weekday as decimal number (0 6; Sunday is 0)
-
%W
Week of year as decimal number, with Monday as first day of week (00 53)
-
%x
Date representation for current locale
-
%X
Time representation for current locale
-
%y
Year without century, as decimal number (00 99)
-
%Y
Year with century, as decimal number
-
%z
,Z Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown
-
%%
Percent sign
As in the printf()
function, the #
flag may prefix any formatting code. In that case, the meaning of the format code is changed as follows.
%#a, %#A, %#b, %#B
Characters are converted to uppercase.
For example: "TUESDAY", "MARCH".
- Parameters
-
[in] | strFormat | Format-control string. |
- Returns
- the formatted string.