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

CP_PropertyList::DateTime Class Reference

Inheritance diagram for CP_PropertyList::DateTime:

CP_PropertyList::Node CP_DateTime CP_CFObject< CFDateRef > CP_M_RefCounted List of all members.

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  enum_MacOSTime { MacOSTime }
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...

Public Member Functions

 DateTime ()
 DateTime (const CP_GregorianDate &inGregorianDate, const CP_TimeZone *inTimeZone=NULL)
 DateTime (const CP_DateTime &inDateTime)
 DateTime (const CP_Date &inDate, const CP_Time &inTime)
 DateTime (const CP_Date &inDate)
 DateTime (const CP_Time &inTime)
 DateTime (const DateTime &inSrc)
 DateTime (CFDateRef inDateRef, bool inRetain=true)
virtual ~DateTime () throw ()
virtual NodeType_t NodeType () const throw ()
virtual void PrintToLog (CP_LogFile &inLogFile, SInt32 inLevel=0, SInt32 inIndentLevel=0) const
virtual CFTypeRef GetNodeCFRef () const
virtual void WriteXMLData (CP_OutStream &inXMLDataStream) const
Getters
UInt32 GetJulian (const CP_TimeZone *inTimeZone=NULL) const
 Returns the date/time in Julian format in the specified time zone.
CP_GregorianDate GetGregorianDate (const CP_TimeZone *inTimeZone=NULL) const
 Returns the Gregorian representation of the date/time in the specified time zone.
UInt16 GetYear (const CP_TimeZone *inTimeZone=NULL) const
 Returns the year of the date/time in the specified time zone.
UInt8 GetMonth (const CP_TimeZone *inTimeZone=NULL) const
 Returns the month of the date/time in the specified time zone.
UInt8 GetDay (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of the date/time in the specified time zone.
UInt8 GetDayOfWeek (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of the week this date falls on in the specified time zone.
UInt16 GetDayOfYear (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of the year this date falls on in the specified time zone.
UInt8 GetDayOfWeekInMonth (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of week in month (e.g. 2 means 2nd Wed in July).
UInt8 GetWeekInYear (const CP_TimeZone *inTimeZone=NULL) const
 Returns the week of year ( 1 to 52(53) ) this date falls in the specified time zone.
UInt8 GetWeekInMonth (const CP_TimeZone *inTimeZone=NULL) const
 Returns the week of month (1 to 5) this date falls in the specified time zone.
CP_String 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.
UInt8 GetHour (const CP_TimeZone *inTimeZone=NULL) const
 Returns the hour portion of the date/time in the specified time zone.
SInt16 GetMinute (const CP_TimeZone *inTimeZone=NULL) const
 Returns the minute portion of the date/time in the specified time zone.
UInt8 GetSecond (const CP_TimeZone *inTimeZone=NULL) const
 Returns the seconds portion of the date/time in the specified time zone.
UInt16 GetMillisecond (const CP_TimeZone *inTimeZone=NULL) const
 Returns the milliseconds portion of the date/time in the specified time zone.
CP_Date GetDate (const CP_TimeZone *inTimeZone=NULL) const
 Returns the date portion of the date/time in the specified time zone.
CP_Time GetTime (const CP_TimeZone *inTimeZone=NULL) const
 Returns the time portion of the date/time in the specified time zone.
void GetLongDate (LongDateRec &outDateRec, const CP_TimeZone *inTimeZone=NULL) const
 Get a MacOS LongDateRec of the date/time in the specified timezone.
UInt32 GetMacSeconds (const CP_TimeZone *inTimeZone=NULL) const
 Get a MacOS seconds value of the date/time in the specified timezone.
CFAbsoluteTime GetAbsoluteTime () const
 Get a CoreFoundation absolute time value for the date.
Setters
void SetToNow ()
void SetGregorianDate (const CP_GregorianDate &inGregorianDate, const CP_TimeZone *inTimeZone=NULL)
 Sets the date/time to the specified Gregorian date in the defined timezone.
void SetYear (UInt16 inYear, const CP_TimeZone *inTimeZone=NULL)
 Sets the year of this date/time.
void SetMonth (UInt8 inMonth, const CP_TimeZone *inTimeZone=NULL)
 Sets the month of this date/time.
void SetDay (UInt8 inDay, const CP_TimeZone *inTimeZone=NULL)
 Sets the date of this date/time.
void SetDayOfWeek (UInt8 inDayOfWeek, const CP_TimeZone *inTimeZone=NULL)
 Sets the date of the week of this date/time.
void SetHour (UInt8 inHour, const CP_TimeZone *inTimeZone=NULL)
 Sets the hour of this date/time.
void SetMinute (UInt8 inMinute, const CP_TimeZone *inTimeZone=NULL)
 Sets the minute of this date/time.
void SetSecond (UInt8 inSecond, const CP_TimeZone *inTimeZone=NULL)
 Sets the second of this date/time.
void SetMillisecond (UInt16 inMillisecond, const CP_TimeZone *inTimeZone=NULL)
 Sets the hour of this date/time.
void SetDate (const CP_Date &inDatePart, const CP_TimeZone *inTimeZone=NULL)
 Sets the date portion of the date/time.
void SetTime (const CP_Time &inTimePart, const CP_TimeZone *inTimeZone=NULL)
 Sets the time portion of the date/time.
void SetDate (const LongDateRec &inDateRec, const CP_TimeZone *inTimeZone=NULL)
Comparisons
bool operator> (const CP_DateTime &inDate) const
 compare to another date/time
bool operator< (const CP_DateTime &inDate) const
 compare to another date/time
bool operator>= (const CP_DateTime &inDate) const
 compare to another date/time
bool operator<= (const CP_DateTime &inDate) const
 compare to another date/time
bool operator== (const CP_DateTime &inDate) const
 compare to another date/time
bool operator!= (const CP_DateTime &inDate) const
 compare to another date/time
bool IsSecondsEqual (const CP_DateTime &inRhs) const
 compare to another date/time to be equal up to the second (but ignoring millisecond differences)
Getters
UInt32 GetJulian (const CP_TimeZone *inTimeZone=NULL) const
 Returns the date/time in Julian format in the specified time zone.
CP_GregorianDate GetGregorianDate (const CP_TimeZone *inTimeZone=NULL) const
 Returns the Gregorian representation of the date/time in the specified time zone.
UInt16 GetYear (const CP_TimeZone *inTimeZone=NULL) const
 Returns the year of the date/time in the specified time zone.
UInt8 GetMonth (const CP_TimeZone *inTimeZone=NULL) const
 Returns the month of the date/time in the specified time zone.
UInt8 GetDay (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of the date/time in the specified time zone.
UInt8 GetDayOfWeek (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of the week this date falls on in the specified time zone.
UInt16 GetDayOfYear (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of the year this date falls on in the specified time zone.
UInt8 GetDayOfWeekInMonth (const CP_TimeZone *inTimeZone=NULL) const
 Returns the day of week in month (e.g. 2 means 2nd Wed in July).
UInt8 GetWeekInYear (const CP_TimeZone *inTimeZone=NULL) const
 Returns the week of year ( 1 to 52(53) ) this date falls in the specified time zone.
UInt8 GetWeekInMonth (const CP_TimeZone *inTimeZone=NULL) const
 Returns the week of month (1 to 5) this date falls in the specified time zone.
CP_String 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.
UInt8 GetHour (const CP_TimeZone *inTimeZone=NULL) const
 Returns the hour portion of the date/time in the specified time zone.
SInt16 GetMinute (const CP_TimeZone *inTimeZone=NULL) const
 Returns the minute portion of the date/time in the specified time zone.
UInt8 GetSecond (const CP_TimeZone *inTimeZone=NULL) const
 Returns the seconds portion of the date/time in the specified time zone.
UInt16 GetMillisecond (const CP_TimeZone *inTimeZone=NULL) const
 Returns the milliseconds portion of the date/time in the specified time zone.
CP_Date GetDate (const CP_TimeZone *inTimeZone=NULL) const
 Returns the date portion of the date/time in the specified time zone.
CP_Time GetTime (const CP_TimeZone *inTimeZone=NULL) const
 Returns the time portion of the date/time in the specified time zone.
void GetLongDate (LongDateRec &outDateRec, const CP_TimeZone *inTimeZone=NULL) const
 Get a MacOS LongDateRec of the date/time in the specified timezone.
UInt32 GetMacSeconds (const CP_TimeZone *inTimeZone=NULL) const
 Get a MacOS seconds value of the date/time in the specified timezone.
CFAbsoluteTime GetAbsoluteTime () const
 Get a CoreFoundation absolute time value for the date.
Setters
void SetToNow ()
void SetGregorianDate (const CP_GregorianDate &inGregorianDate, const CP_TimeZone *inTimeZone=NULL)
 Sets the date/time to the specified Gregorian date in the defined timezone.
void SetYear (UInt16 inYear, const CP_TimeZone *inTimeZone=NULL)
 Sets the year of this date/time.
void SetMonth (UInt8 inMonth, const CP_TimeZone *inTimeZone=NULL)
 Sets the month of this date/time.
void SetDay (UInt8 inDay, const CP_TimeZone *inTimeZone=NULL)
 Sets the date of this date/time.
void SetDayOfWeek (UInt8 inDayOfWeek, const CP_TimeZone *inTimeZone=NULL)
 Sets the date of the week of this date/time.
void SetHour (UInt8 inHour, const CP_TimeZone *inTimeZone=NULL)
 Sets the hour of this date/time.
void SetMinute (UInt8 inMinute, const CP_TimeZone *inTimeZone=NULL)
 Sets the minute of this date/time.
void SetSecond (UInt8 inSecond, const CP_TimeZone *inTimeZone=NULL)
 Sets the second of this date/time.
void SetMillisecond (UInt16 inMillisecond, const CP_TimeZone *inTimeZone=NULL)
 Sets the hour of this date/time.
void SetDate (const CP_Date &inDatePart, const CP_TimeZone *inTimeZone=NULL)
 Sets the date portion of the date/time.
void SetDate (const LongDateRec &inDateRec, const CP_TimeZone *inTimeZone=NULL)
void SetTime (const CP_Time &inTimePart, const CP_TimeZone *inTimeZone=NULL)
 Sets the time portion of the date/time.
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_TimeInterval operator- (const CP_DateTime &inRhs) const
 Calculates the time interval between two date/times.
CP_DateTimeoperator-= (CP_TimeInterval inTimeInterval)
 Subtracts the specified time interval from the 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.
Comparisons
bool operator> (const CP_DateTime &inDate) const
 compare to another date/time
bool operator< (const CP_DateTime &inDate) const
 compare to another date/time
bool operator>= (const CP_DateTime &inDate) const
 compare to another date/time
bool operator<= (const CP_DateTime &inDate) const
 compare to another date/time
bool operator== (const CP_DateTime &inDate) const
 compare to another date/time
bool operator!= (const CP_DateTime &inDate) const
 compare to another date/time
bool IsSecondsEqual (const CP_DateTime &inRhs) const
 compare to another date/time to be equal up to the second (but ignoring millisecond differences)

Static Public Member Functions

static DateTimeFromXMLData (CP_InStream &inXMLDataStream)
static NodeFromXMLData (CP_InStream &inXMLDataStream, NodeType_t inExpectedNodeType=NodeType_Any)
static NodeCreateNodeForCFObject (CFTypeRef inObject)
static CP_DateTime Now ()
 Returns the current date & time.

Protected Attributes

CFAbsoluteTime fAbsoluteTime

Private Member Functions

void AttachRef (CFDateRefinRef, bool inRetain)
CFDateRef DetachRef ()
CFDateRef GetCFRef () const
bool IsValid () const

Private Attributes

CFDateRef fCFObject

Member Enumeration Documentation

enum CP_DateTime::enum_MacOSTime [inherited]
 

Enumeration values:
MacOSTime 

enum CP_DateTime::FormatStyle [inherited]
 

"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. "2005-01-02Z18:34:59")
DefaultDateFormat 
DefaultTimeFormat 


Constructor & Destructor Documentation

CP_PropertyList::DateTime::DateTime  ) 
 

CP_PropertyList::DateTime::DateTime const CP_GregorianDate inGregorianDate,
const CP_TimeZone inTimeZone = NULL
[explicit]
 

CP_PropertyList::DateTime::DateTime const CP_DateTime inDateTime  )  [explicit]
 

CP_PropertyList::DateTime::DateTime const CP_Date inDate,
const CP_Time inTime
[explicit]
 

CP_PropertyList::DateTime::DateTime const CP_Date inDate  )  [explicit]
 

CP_PropertyList::DateTime::DateTime const CP_Time inTime  )  [explicit]
 

CP_PropertyList::DateTime::DateTime const DateTime inSrc  ) 
 

CP_PropertyList::DateTime::DateTime CFDateRef  inDateRef,
bool  inRetain = true
[explicit]
 

CP_PropertyList::DateTime::~DateTime  )  throw () [virtual]
 


Member Function Documentation

NodeType_t CP_PropertyList::DateTime::NodeType  )  const throw () [virtual]
 

Implements CP_PropertyList::Node.

DateTime * CP_PropertyList::DateTime::FromXMLData CP_InStream inXMLDataStream  )  [static]
 

void CP_PropertyList::DateTime::PrintToLog CP_LogFile inLogFile,
SInt32  inLevel = 0,
SInt32  inIndentLevel = 0
const [virtual]
 

Implements CP_PropertyList::Node.

virtual CFTypeRef CP_PropertyList::DateTime::GetNodeCFRef  )  const [virtual]
 

Implements CP_PropertyList::Node.

void CP_PropertyList::Node::WriteXMLData CP_OutStream inXMLDataStream  )  const [virtual, inherited]
 

Node * CP_PropertyList::Node::FromXMLData CP_InStream inXMLDataStream,
NodeType_t  inExpectedNodeType = NodeType_Any
[static, inherited]
 

static Node* CP_PropertyList::Node::CreateNodeForCFObject CFTypeRef  inObject  )  [static, inherited]
 

UInt32 CP_M_RefCounted::AddReference  )  const [inherited]
 

Add a reference to our object, returning the new reference count.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

UInt32 CP_M_RefCounted::RemoveReference  )  const [inherited]
 

Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

void CP_M_RefCounted::Autorelease  )  const [inherited]
 

Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.

See also:
CP_AutoReleasePool
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::GetRefCount  )  const [inherited]
 

Returns the current ref count.

Exceptions:
none 
Returns:
UInt32 The current referencce count.

CP_DateTime CP_DateTime::Now  )  [static, inherited]
 

Returns the current date & time.

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

UInt32 CP_DateTime::GetJulian const CP_TimeZone inTimeZone = NULL  )  const [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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 [inherited]
 

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::GetLongDate LongDateRec &  outDateRec,
const CP_TimeZone inTimeZone = NULL
const [inherited]
 

UInt32 CP_DateTime::GetMacSeconds const CP_TimeZone inTimeZone = NULL  )  const [inherited]
 

CFAbsoluteTime CP_DateTime::GetAbsoluteTime  )  const [inherited]
 

void CP_DateTime::SetToNow  )  [inherited]
 

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

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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::SetDate const LongDateRec &  inDateRec,
const CP_TimeZone inTimeZone = NULL
[inherited]
 

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::SetTime const CP_Time inTimePart,
const CP_TimeZone inTimeZone = NULL
[inherited]
 

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 [inherited]
 

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  )  [inherited]
 

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 [inherited]
 

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_TimeInterval CP_DateTime::operator- const CP_DateTime inRhs  )  const [inherited]
 

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-= CP_TimeInterval  inTimeInterval  )  [inherited]
 

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_DateTime & CP_DateTime::AddGregorianUnits const CP_GregorianUnits inUnitsToAdd,
const CP_TimeZone inTimeZone = NULL
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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
[inherited]
 

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 [inherited]
 

bool CP_DateTime::operator< const CP_DateTime inDate  )  const [inherited]
 

bool CP_DateTime::operator>= const CP_DateTime inDate  )  const [inherited]
 

bool CP_DateTime::operator<= const CP_DateTime inDate  )  const [inherited]
 

bool CP_DateTime::operator== const CP_DateTime inDate  )  const [inherited]
 

bool CP_DateTime::operator!= const CP_DateTime inDate  )  const [inherited]
 

bool CP_DateTime::IsSecondsEqual const CP_DateTime inRhs  )  const [inherited]
 

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

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, inherited]
 

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 [inherited]
 

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 [inherited]
 

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_CFObject< CFDateRef >::AttachRef CFDateRef   inRef,
bool  inRetain
[inherited]
 

CFDateRef CP_CFObject< CFDateRef >::DetachRef  )  [inherited]
 

CFDateRef CP_CFObject< CFDateRef >::GetCFRef  )  const [inherited]
 

bool CP_CFObject< CFDateRef >::IsValid  )  const [inherited]
 


Member Data Documentation

CFAbsoluteTime CP_DateTime::fAbsoluteTime [protected, inherited]
 

CFDateRef CP_CFObject< CFDateRef >::fCFObject [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:22:26 2005 for CPLAT_MacOS by  doxygen 1.4.0