Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_DateTime Class Reference

A class for dealing with full dates (i.e. a date + time). More...

Inheritance diagram for CP_DateTime:

CP_PropertyList::DateTime List of all members.

Math

CP_DateTime operator+ (CP_TimeInterval inTimeInterval) const
 Adds the specified time interval to the date/time.
CP_DateTimeoperator+= (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_DateTimeoperator-= (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_DateTimeoperator= (const CP_DateTime &inRhs)
 Assign a date/time.
CP_DateTimeAddGregorianUnits (const CP_GregorianUnits &inUnitsToAdd, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of years to the date.
CP_DateTimeAddYears (SInt32 inYears, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of years to the date.
CP_DateTimeSubtractYears (SInt32 inYears, const CP_TimeZone *inTimeZone=NULL)
 Subtract the specified number of years from the date.
CP_DateTimeAddMonths (SInt32 inMonths, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of months to the date.
CP_DateTimeSubtractMonths (SInt32 inMonths, const CP_TimeZone *inTimeZone=NULL)
 Subtract the specified number of months from the date.
CP_DateTimeAddDays (SInt32 inDays, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of days to the date.
CP_DateTimeSubtractDays (SInt32 inDays, const CP_TimeZone *inTimeZone=NULL)
 Subtract the specified number of days from the date.
CP_DateTimeAddHours (SInt32 inHours, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of hours to the date.
CP_DateTimeSubtractHours (SInt32 inHours, const CP_TimeZone *inTimeZone=NULL)
 Subtract the specified number of hours from the date.
CP_DateTimeAddMinutes (SInt32 inMinutes, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of minutes to the date.
CP_DateTimeSubtractMinutes (SInt32 inMinutes, const CP_TimeZone *inTimeZone=NULL)
 Subtract the specified number of minutes from the date.
CP_DateTimeAddSeconds (double inSeconds, const CP_TimeZone *inTimeZone=NULL)
 Adds the specified number of seconds to the date.
CP_DateTimeSubtractSeconds (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

Detailed Description

The CP_DateTime class provides methods for performing math on full dates. Dates stored in CP_DateTime are always valid. Exceptions will be raised when trying to assign an invalid date.

There are also methods to return the time in a specific formatted way.


Member Enumeration Documentation

enum CP_DateTime::FormatStyle
 

"Fuzzy" formatting styles, which depend largely on user and locale settings.

  • Short style is usually plain numeric, e.g. "12/13/52" or "3:30pm"
  • Medium is longer, such as "Jan. 12, 1952"
  • Long is longer, such as e.g. "January 12, 1952" or "3:30:32pm"
  • Full is completely specified, such as "Tuesday, April 12, 1952 AD" or "3:30:42PM PST"
See also:
http://oss.software.ibm.com/icu/userguide/formatDateTime.html "ICU Formatting Options"
Enumeration values:
Format_none  specified part is not included in formatted string
Format_short  use short format, usually numeric only
Format_medium  use medium format, usually abbreviated
Format_long  use long format
Format_full  use full format, including every detail
Format_ISO  use format defined by ISO 8601 (e.g. "2004-01-02Z18:34:59")
DefaultDateFormat 
DefaultTimeFormat 

enum CP_DateTime::enum_MacOSTime
 

Enumeration values:
MacOSTime 


Constructor & Destructor Documentation

CP_DateTime::CP_DateTime  ) 
 

CP_DateTime::CP_DateTime const CP_DateTime inSrc  ) 
 

CP_DateTime::CP_DateTime const CP_Date inDate,
const CP_Time inTime,
const CP_TimeZone inTimeZone = NULL
 

CP_DateTime::CP_DateTime const CP_Date inDate,
const CP_TimeZone inTimeZone = NULL
[explicit]
 

CP_DateTime::CP_DateTime const CP_Time inTime,
const CP_TimeZone inTimeZone = NULL
[explicit]
 

CP_DateTime::CP_DateTime const CP_GregorianDate inGregorianDate,
const CP_TimeZone inTimeZone = NULL
 

CP_DateTime::CP_DateTime CP_STD::time_t  inTime  ) 
 

CP_DateTime::~CP_DateTime  )  throw ()
 

CP_DateTime::CP_DateTime UInt32  inMacSeconds,
enum_MacOSTime  inMacOSTime,
const CP_TimeZone inTimeZone = NULL
 

CP_DateTime::CP_DateTime const LongDateRec &  inDateRec,
const CP_TimeZone inTimeZone = NULL
 

CP_DateTime::CP_DateTime CFDateRef  inDateRef  ) 
 

CP_DateTime::CP_DateTime CFAbsoluteTime  inAbsoluteTime  ) 
 

CP_DateTime::CP_DateTime SYSTEMTIME  inSystemTime,
const CP_TimeZone inTimeZone = NULL
 

CP_DateTime::CP_DateTime FILETIME  inSystemTime  ) 
 


Member Function Documentation

CP_DateTime CP_DateTime::Now  )  [static]
 

Returns the current date & time.

Exceptions:
none 
Returns:
CP_DateTime The current date/time.

UInt32 CP_DateTime::GetJulian const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the date/time in Julian format in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt32 The date in Julian format in the specified time zone.

CP_GregorianDate CP_DateTime::GetGregorianDate const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the year of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt16 The year portion of the date in the specified time zone.

UInt16 CP_DateTime::GetYear const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the year of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt16 The year portion of the date in the specified time zone.

UInt8 CP_DateTime::GetMonth const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the month of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The month portion of the date.

UInt8 CP_DateTime::GetDay const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the day of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The day portion of the date.

UInt8 CP_DateTime::GetDayOfWeek const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the day of the week this date falls on in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The date of the week of this date. 1 is Monday, 2 is Tuesday, etc......Sunday is 7

UInt16 CP_DateTime::GetDayOfYear const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the day of the year this date falls on in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The day of year, 1 January will return 1, 31 December will be 365 (or 366 for leap year)

UInt8 CP_DateTime::GetDayOfWeekInMonth const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the day of week in month (e.g. 2 means 2nd Wed in July)

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The day of week in month (1 means first Sat in month, 3 means third Thu in month)

UInt8 CP_DateTime::GetWeekInYear const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the week in year

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The week number in year. The values returned are from 1 to 53

UInt8 CP_DateTime::GetWeekInMonth const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the week in month (e.g. 2 is 2nd week in month)

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 The week in month (values are from 1 to 6)

CP_String CP_DateTime::GetMonthString bool  inShortVersion = false,
const CP_TimeZone inTimeZone = NULL
const
 

Returns the name of the month this date falls on in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
CP_String Name of the month portion of the date.

UInt8 CP_DateTime::GetHour const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the hour portion of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 Hour portion of the time.

SInt16 CP_DateTime::GetMinute const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the minute portion of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
SInt16 Minute portion of the time.

UInt8 CP_DateTime::GetSecond const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the seconds portion of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt8 Seconds portion of the time.

UInt16 CP_DateTime::GetMillisecond const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the milliseconds portion of the date/time in the specified time zone.

Note:
Milliseconds may not be supported on all platforms, in which case this call will always return 0.
Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
UInt16 Milliseconds portion of the time.

CP_Date CP_DateTime::GetDate const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the date portion of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the date in, or NULL to use the default time zone.
Returns:
CP_Date Date portion of the date/time.

CP_Time CP_DateTime::GetTime const CP_TimeZone inTimeZone = NULL  )  const
 

Returns the time portion of the date/time in the specified time zone.

Exceptions:
none 
Parameters:
inTimeZone The time zone to return the time in, or NULL to use the default time zone.
Returns:
CP_Time Time portion of the date/time.

void CP_DateTime::SetToNow  ) 
 

void CP_DateTime::SetGregorianDate const CP_GregorianDate inGregorianDate,
const CP_TimeZone inTimeZone = NULL
 

Sets the year of this date/time.

Parameters:
inGregorianDate The Gregorian representation of the date/time to set.
inTimeZone The time zone to work in, or NULL to use the default time zone.
Exceptions:
CP_BoundsException when date does not exist.
Returns:
void

void CP_DateTime::SetYear UInt16  inYear,
const CP_TimeZone inTimeZone = NULL
 

Sets the year of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inYear The year of this date/time.
Exceptions:
CP_BoundsException when date does not exist.
Returns:
void

void CP_DateTime::SetMonth UInt8  inMonth,
const CP_TimeZone inTimeZone = NULL
 

Sets the month of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inMonth The month of this date/time.
Exceptions:
CP_BoundsException when date does not exist.
Returns:
void

void CP_DateTime::SetDay UInt8  inDay,
const CP_TimeZone inTimeZone = NULL
 

Sets the date of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inDay The day of this date/time.
Exceptions:
CP_BoundsException when date does not exist.
Returns:
void

void CP_DateTime::SetDayOfWeek UInt8  inDayOfWeek,
const CP_TimeZone inTimeZone = NULL
 

Sets the date of the week of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inDayOfWeek The date of the week of this date/time.
Exceptions:
none 
Returns:
void
Todo:
to be implemented

void CP_DateTime::SetHour UInt8  inHour,
const CP_TimeZone inTimeZone = NULL
 

Sets the hour of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inHour The hour of this date/time.
Exceptions:
none 
Returns:
void

void CP_DateTime::SetMinute UInt8  inMinute,
const CP_TimeZone inTimeZone = NULL
 

Sets the minute of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inMinute The minute of this date/time.
Exceptions:
none 
Returns:
void

void CP_DateTime::SetSecond UInt8  inSecond,
const CP_TimeZone inTimeZone = NULL
 

Sets the second of this date/time.

Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inSecond The second of this date/time.
Exceptions:
none 
Returns:
void

void CP_DateTime::SetMillisecond UInt16  inMillisecond,
const CP_TimeZone inTimeZone = NULL
 

Sets the hour of this date/time.

Note:
Milliseconds may not be supported on all platforms, in which case this call acts as a no-op.
Parameters:
inTimeZone The time zone to work in, or NULL to use the default time zone.
inMillisecond The millisecond of this date/time.
Exceptions:
none 
Returns:
void

void CP_DateTime::SetDate const CP_Date inDatePart,
const CP_TimeZone inTimeZone = NULL
 

Sets the date portion of the date/time.

Exceptions:
CP_BoundsException when date does not exist.
Parameters:
inDatePart Date portion of the date/time.
inTimeZone The time zone to work in, or NULL to use the default time zone.

void CP_DateTime::SetTime const CP_Time inTimePart,
const CP_TimeZone inTimeZone = NULL
 

Sets the time portion of the date/time.

Exceptions:
none 
Parameters:
inTimePart Time portion of the date/time.
inTimeZone The time zone to work in, or NULL to use the default time zone.

CP_DateTime CP_DateTime::operator+ CP_TimeInterval  inTimeInterval  )  const
 

Adds the specified time interval to the date/time, creating a new object with the resulting date.

Exceptions:
none 
Parameters:
inTimeInterval Time interval to add to the date/time.
Returns:
CP_DateTime A date/time object containing the result of the calculation.

CP_DateTime & CP_DateTime::operator+= CP_TimeInterval  inTimeInterval  ) 
 

Adds the specified time interval to the date/time.

Exceptions:
none 
Parameters:
inTimeInterval Time interval to add to the date/time.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime CP_DateTime::operator- CP_TimeInterval  inTimeInterval  )  const
 

Subtracts the specified time interval from the date/time, creating a new object with the resulting date.

Exceptions:
none 
Parameters:
inTimeInterval Time interval to subtract from the date/time.
Returns:
CP_DateTime A date/time object containing the result of the calculation.

CP_DateTime & CP_DateTime::operator-= CP_TimeInterval  inTimeInterval  ) 
 

Subtracts the specified time interval from the date/time.

Exceptions:
none 
Parameters:
inTimeInterval Time interval to subtract from the date/time.
Returns:
CP_DateTime& A reference to this object.

CP_TimeInterval CP_DateTime::operator- const CP_DateTime inRhs  )  const
 

Calculates the time interval between two date/times.

Exceptions:
none 
Parameters:
inRhs The date/time to subtract from this date/time.
Returns:
CP_TimeInterval The time interval between inRhs and this date/time.

CP_DateTime & CP_DateTime::operator= const CP_DateTime inRhs  ) 
 

Assign a date/time.

Exceptions:
none 
Parameters:
inRhs The new date.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddGregorianUnits const CP_GregorianUnits inUnitsToAdd,
const CP_TimeZone inTimeZone = NULL
 

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.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inYears The number of years to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddYears SInt32  inYears,
const CP_TimeZone inTimeZone = NULL
 

Adds the specified number of years to the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inYears The number of years to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::SubtractYears SInt32  inYears,
const CP_TimeZone inTimeZone = NULL
 

Subtract the specified number of years from the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inYears The number of years to subtract.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddMonths SInt32  inMonths,
const CP_TimeZone inTimeZone = NULL
 

Adds the specified number of months to the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inMonths The number of months to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::SubtractMonths SInt32  inMonths,
const CP_TimeZone inTimeZone = NULL
 

Subtract the specified number of months from the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inMonths The number of months to subtract.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddDays SInt32  inDays,
const CP_TimeZone inTimeZone = NULL
 

Adds the specified number of days to the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inDays The number of days to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::SubtractDays SInt32  inDays,
const CP_TimeZone inTimeZone = NULL
 

Subtract the specified number of days from the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inDays The number of days to subtract.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddHours SInt32  inHours,
const CP_TimeZone inTimeZone = NULL
 

Adds the specified number of hours to the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inHours The number of hours to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::SubtractHours SInt32  inHours,
const CP_TimeZone inTimeZone = NULL
 

Subtract the specified number of hours from the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inHours The number of hours to subtract.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddMinutes SInt32  inMinutes,
const CP_TimeZone inTimeZone = NULL
 

Adds the specified number of minutes to the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inMinutes The number of minutes to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::SubtractMinutes SInt32  inMinutes,
const CP_TimeZone inTimeZone = NULL
 

Subtract the specified number of minutes from the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inMinutes The number of minutes to subtract.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::AddSeconds double  inSeconds,
const CP_TimeZone inTimeZone = NULL
 

Adds the specified number of seconds to the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inSeconds The number of seconds to add.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

CP_DateTime & CP_DateTime::SubtractSeconds double  inSeconds,
const CP_TimeZone inTimeZone = NULL
 

Subtract the specified number of seconds from the date.

Exceptions:
CP_BoundsException if date goes out of bounds.
Parameters:
inSeconds The number of seconds to subtract.
inTimeZone The timezone to use when working with Gregorian units.
Returns:
CP_DateTime& A reference to this object.

bool CP_DateTime::operator> const CP_DateTime inDate  )  const
 

bool CP_DateTime::operator< const CP_DateTime inDate  )  const
 

bool CP_DateTime::operator>= const CP_DateTime inDate  )  const
 

bool CP_DateTime::operator<= const CP_DateTime inDate  )  const
 

bool CP_DateTime::operator== const CP_DateTime inDate  )  const
 

bool CP_DateTime::operator!= const CP_DateTime inDate  )  const
 

bool CP_DateTime::IsSecondsEqual const CP_DateTime inRhs  )  const
 

CP_DateTime CP_DateTime::FromString const CP_String inDateString,
FormatStyle  inDateFormat,
FormatStyle  inTimeFormat,
const CP_TimeZone inTimeZone = NULL
[static]
 

Parse a date/time string and return the corresponding date/time.

Exceptions:
std::bad_cast when string can't be converted.
std::invalid_argument when date specified by string does not exist or string cannot be properly parsed.
Parameters:
inDateString A string representing a date/time.
inDateFormat How is the date part within the string formatted?
inTimeFormat How is the time part within the string formatted?
inTimeZone The time zone to work in, or NULL to use the default time zone.
Returns:
CP_DateTime The date/time as specified by the input string.

CP_DateTime CP_DateTime::FromStringGivenFormat const CP_String inDateString,
const CP_String inFormatString,
const CP_TimeZone inTimeZone = NULL
[static]
 

Parse a date/time string and return the corresponding date/time.

Exceptions:
std::bad_cast when string can't be converted.
std::invalid_argument when date specified by string does not exist or string cannot be properly parsed.
Parameters:
inDateString A string representing a date/time.
inFormatString ICU compatible format string specifying how the date/time is formatted.
inTimeZone The time zone to work in, or NULL to use the default time zone.
Returns:
CP_DateTime The date/time as specified by the input string.
See also:
http://oss.software.ibm.com/icu/userguide/formatDateTime.html "ICU - Formatting Dates and Times" for format string details.

CP_String CP_DateTime::Format FormatStyle  inDateFormat = DefaultDateFormat,
FormatStyle  inTimeFormat = DefaultTimeFormat,
const CP_TimeZone inTimeZone = NULL
const
 

Creates a string representation of the date/time with the specified format.

Exceptions:
none. 
Parameters:
inDateFormat The style to use when formatting the date part.
inTimeFormat The style to use when formatting the time part.
inTimeZone The time zone to format the date in, or NULL to use the default time zone.
Returns:
CP_String The string representation of the date/time.
Todo:
fetch from resources?

CP_String CP_DateTime::Format const CP_String inFormatString,
const CP_TimeZone inTimeZone = NULL
const
 

Creates a string representation of the date/time with the specified format.

Exceptions:
none. 
Parameters:
inFormatString ICU compatible format string specifying how to format the date/time.
inTimeZone The time zone to format the date in, or NULL to use the default time zone.
Returns:
CP_String The string representation of the date/time.
See also:
http://oss.software.ibm.com/icu/userguide/formatDateTime.html "ICU - Formatting Dates and Times" for format string details.

void CP_DateTime::GetLongDate LongDateRec &  outDateRec,
const CP_TimeZone inTimeZone = NULL
const
 

UInt32 CP_DateTime::GetMacSeconds const CP_TimeZone inTimeZone = NULL  )  const
 

CFAbsoluteTime CP_DateTime::GetAbsoluteTime  )  const
 

void CP_DateTime::SetDate const LongDateRec &  inDateRec,
const CP_TimeZone inTimeZone = NULL
 

Set the date/time from the specified Mac OS LongDateRec taking into account the specified time zone.

Parameters:
inDateRec The Mac OS date record containing the gregorian date representation in the specified time zone.
inTimeZone The timezone to use or NULL to use the default timezone.

void CP_DateTime::GetDate SYSTEMTIME &  inSystemTime,
const CP_TimeZone inTimeZone = NULL
const
 

FILETIME CP_DateTime::GetAbsoluteTime  )  const
 

void CP_DateTime::SetDate const SYSTEMTIME &  inSystemTime,
const CP_TimeZone inTimeZone = NULL
 

void CP_DateTime::SetAbsoluteTime const FILETIME &  theFileTime  ) 
 


Member Data Documentation

CFAbsoluteTime CP_DateTime::fAbsoluteTime [protected]
 

FILETIME CP_DateTime::fAbsoluteTime [protected]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:28 2005 for CPLAT by  doxygen 1.4.0