Inheritance diagram for CP_DateTime:
Math | |
CP_DateTime | operator+ (CP_TimeInterval inTimeInterval) const |
Adds the specified time interval to the date/time. | |
CP_DateTime & | operator+= (CP_TimeInterval inTimeInterval) |
Adds the specified time interval to the date/time. | |
CP_DateTime | operator- (CP_TimeInterval inTimeInterval) const |
Subtracts the specified time interval from the date/time. | |
CP_DateTime & | operator-= (CP_TimeInterval inTimeInterval) |
Subtracts the specified time interval from the date/time. | |
CP_TimeInterval | operator- (const CP_DateTime &inRhs) const |
Calculates the time interval between two date/times. | |
CP_DateTime & | operator= (const CP_DateTime &inRhs) |
Assign a date/time. | |
CP_DateTime & | AddGregorianUnits (const CP_GregorianUnits &inUnitsToAdd, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of years to the date. | |
CP_DateTime & | AddYears (SInt32 inYears, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of years to the date. | |
CP_DateTime & | SubtractYears (SInt32 inYears, const CP_TimeZone *inTimeZone=NULL) |
Subtract the specified number of years from the date. | |
CP_DateTime & | AddMonths (SInt32 inMonths, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of months to the date. | |
CP_DateTime & | SubtractMonths (SInt32 inMonths, const CP_TimeZone *inTimeZone=NULL) |
Subtract the specified number of months from the date. | |
CP_DateTime & | AddDays (SInt32 inDays, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of days to the date. | |
CP_DateTime & | SubtractDays (SInt32 inDays, const CP_TimeZone *inTimeZone=NULL) |
Subtract the specified number of days from the date. | |
CP_DateTime & | AddHours (SInt32 inHours, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of hours to the date. | |
CP_DateTime & | SubtractHours (SInt32 inHours, const CP_TimeZone *inTimeZone=NULL) |
Subtract the specified number of hours from the date. | |
CP_DateTime & | AddMinutes (SInt32 inMinutes, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of minutes to the date. | |
CP_DateTime & | SubtractMinutes (SInt32 inMinutes, const CP_TimeZone *inTimeZone=NULL) |
Subtract the specified number of minutes from the date. | |
CP_DateTime & | AddSeconds (double inSeconds, const CP_TimeZone *inTimeZone=NULL) |
Adds the specified number of seconds to the date. | |
CP_DateTime & | SubtractSeconds (double inSeconds, const CP_TimeZone *inTimeZone=NULL) |
Subtract the specified number of seconds from the date. | |
String conversions | |
CP_String | Format (FormatStyle inDateFormat=DefaultDateFormat, FormatStyle inTimeFormat=DefaultTimeFormat, const CP_TimeZone *inTimeZone=NULL) const |
Format a date. | |
CP_String | Format (const CP_String &inFormatString, const CP_TimeZone *inTimeZone=NULL) const |
Format a date. | |
static CP_DateTime | FromString (const CP_String &inDateString, FormatStyle inDateFormat, FormatStyle inTimeFormat, const CP_TimeZone *inTimeZone=NULL) |
Parse a date/time string. | |
static CP_DateTime | FromStringGivenFormat (const CP_String &inDateString, const CP_String &inFormatString, const CP_TimeZone *inTimeZone=NULL) |
Parse a date/time string. | |
Public Types | |
enum | FormatStyle { Format_none = 0, Format_short, Format_medium, Format_long, Format_full, Format_ISO, DefaultDateFormat = Format_medium, DefaultTimeFormat = Format_medium } |
Formatting styles for date & time. More... | |
enum | enum_MacOSTime { MacOSTime } |
Public Member Functions | |
Constructor / Destructor | |
CP_DateTime () | |
Constructor. | |
CP_DateTime (const CP_DateTime &inSrc) | |
CP_DateTime (const CP_Date &inDate, const CP_Time &inTime, const CP_TimeZone *inTimeZone=NULL) | |
Construct date/time with date and time. | |
CP_DateTime (const CP_Date &inDate, const CP_TimeZone *inTimeZone=NULL) | |
Construct date/time with time at midnight of the specified date. | |
CP_DateTime (const CP_Time &inTime, const CP_TimeZone *inTimeZone=NULL) | |
Construct date/time with date at date origin and time as specified. | |
CP_DateTime (const CP_GregorianDate &inGregorianDate, const CP_TimeZone *inTimeZone=NULL) | |
Construct date/time with the specified Gregorian date. | |
CP_DateTime (CP_STD::time_t inTime) | |
Construct date/time with the specified system date. | |
~CP_DateTime () throw () | |
Destructor. | |
Constructor / Destructor | |
CP_DateTime (UInt32 inMacSeconds, enum_MacOSTime inMacOSTime, const CP_TimeZone *inTimeZone=NULL) | |
Mac specific Constructor. | |
CP_DateTime (const LongDateRec &inDateRec, const CP_TimeZone *inTimeZone=NULL) | |
Mac specific Constructor. | |
CP_DateTime (CFDateRef inDateRef) | |
Mac specific Constructor. | |
CP_DateTime (CFAbsoluteTime inAbsoluteTime) | |
Mac specific Constructor. | |
Constructor / Destructor | |
CP_DateTime (SYSTEMTIME inSystemTime, const CP_TimeZone *inTimeZone=NULL) | |
Constructor. | |
CP_DateTime (FILETIME inSystemTime) | |
Constructor. | |
Static Public Member Functions | |
static CP_DateTime | Now () |
Returns the current date & time. | |
Protected Attributes | |
CFAbsoluteTime | fAbsoluteTime |
FILETIME | fAbsoluteTime |
There are also methods to return the time in a specific formatted way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the current date & time.
|
|
Returns the date/time in Julian format in the specified time zone.
|
|
Returns the year of the date/time in the specified time zone.
|
|
Returns the year of the date/time in the specified time zone.
|
|
Returns the month of the date/time in the specified time zone.
|
|
Returns the day of the date/time in the specified time zone.
|
|
Returns the day of the week this date falls on in the specified time zone.
|
|
Returns the day of the year this date falls on in the specified time zone.
|
|
Returns the day of week in month (e.g. 2 means 2nd Wed in July)
|
|
Returns the week in year
|
|
Returns the week in month (e.g. 2 is 2nd week in month)
|
|
Returns the name of the month this date falls on in the specified time zone.
|
|
Returns the hour portion of the date/time in the specified time zone.
|
|
Returns the minute portion of the date/time in the specified time zone.
|
|
Returns the seconds portion of the date/time in the specified time zone.
|
|
Returns the milliseconds portion of the date/time in the specified time zone.
|
|
Returns the date portion of the date/time in the specified time zone.
|
|
Returns the time portion of the date/time in the specified time zone.
|
|
|
|
Sets the year of this date/time.
|
|
Sets the year of this date/time.
|
|
Sets the month of this date/time.
|
|
Sets the date of this date/time.
|
|
Sets the date of the week of this date/time.
|
|
Sets the hour of this date/time.
|
|
Sets the minute of this date/time.
|
|
Sets the second of this date/time.
|
|
Sets the hour of this date/time.
|
|
Sets the date portion of the date/time.
|
|
Sets the time portion of the date/time.
|
|
Adds the specified time interval to the date/time, creating a new object with the resulting date.
|
|
Adds the specified time interval to the date/time.
|
|
Subtracts the specified time interval from the date/time, creating a new object with the resulting date.
|
|
Subtracts the specified time interval from the date/time.
|
|
Calculates the time interval between two date/times.
|
|
Assign a date/time.
|
|
Adds the specified Gregorian units to the date. The date and the units are assumed to represent a point in time in the specified timezone.
|
|
Adds the specified number of years to the date.
|
|
Subtract the specified number of years from the date.
|
|
Adds the specified number of months to the date.
|
|
Subtract the specified number of months from the date.
|
|
Adds the specified number of days to the date.
|
|
Subtract the specified number of days from the date.
|
|
Adds the specified number of hours to the date.
|
|
Subtract the specified number of hours from the date.
|
|
Adds the specified number of minutes to the date.
|
|
Subtract the specified number of minutes from the date.
|
|
Adds the specified number of seconds to the date.
|
|
Subtract the specified number of seconds from the date.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Parse a date/time string and return the corresponding date/time.
|
|
Parse a date/time string and return the corresponding date/time.
|
|
Creates a string representation of the date/time with the specified format.
|
|
Creates a string representation of the date/time with the specified format.
|
|
|
|
|
|
|
|
Set the date/time from the specified Mac OS LongDateRec taking into account the specified time zone.
|
|
|
|
|
|
|
|
|
|
|
|
|