ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/FoundationKit/Classes/NSCalendarDate.rtf

This is NSCalendarDate.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSCalendarDate 
pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSDate : NSObject
fs20 
fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding, NSCopying (NSDate)
fi0 NSObject (NSObject)
fs20 
fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSDate.h 
fs20 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 NSCalendarDate is a public subclass of NSDate that defines concrete date objects. These objects have time zones and format strings bound to them and are especially suited for representing and manipulating dates according to western calendrical systems. 
fs16 
fs28 By drawing on the behavior of the NSTimeZone class, NSCalendarDate objects adjust their visible representations to reflect their associated time zones. Because of this, you can track an NSCalendarDate object across different time zones. You can also present date information from time-zone viewpoints other than the one for the current locale.
fs16 
fs28 Each NSCalendarDate object also has a calendar format string bound to it. This format string contains date-conversion specifiers that are very similar to those used in the standard C library function b strftime()b0 . By reference to this format string, NSCalendarDate can interpret dates that are represented as strings conforming to the format. Several methods allow you to specify formats other than the one bound to the object, and b setCalendarFormat:b0  lets you change the default format string for an NSCalendarDate object.
fs16 
fs28 NSCalendarDate provides both class and instance methods for obtaining initialized objects. Some of these methods allow you to initialize date objects from strings while others initialize objects from sets of integers corresponding the standard time values (months, hours, seconds, etc.). As always, you are responsible for deallocating any objects obtained through an b alloc...b0  or b copy...b0  method.
fs16 
fs28 To retrieve conventional elements of a date, use the methods of the form b dayOfWeekb0 , b monthOfYearb0 , and so on. For example, b dayOfWeekb0  returns a number that indicates the day of the week (0 is Sunday). The b monthOfYearb0  method returns a number from 1 to 12 that indicates the month.
fs16 
fs28 NSCalendarDate provides several methods for representing dates as strings. These methods'd0b descriptionb0 , b descriptionWithLocale:b0 , b descriptionWithCalendarFormatb0 :, and b descriptionWithCalendarFormat:timeZone:b0 'd0take an implicit or explicit format string.
fs16 
fs28 NSCalendarDate performs date computations based on western calendar systems, primarily the Gregorian. (The algorithms are derived from public domain software described in 'aaCalendrical Calculations,'ba a two-part series by Nachum Dershowitz and Edward M. Reingold in i Software'd0Practice and Experiencei0 ).
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 General Exceptions
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 NSCalendarDate will raise NSInvalidArgumentException in the general case where numeric character strings to specify years, months, days, and so on, are not valid numbers.
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Getting and Initializing an NSCalendar Date 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (NSCalendarDate *)b calendarDateb0 tab Returns an NSCalendarDate initialized to the current date and time.
fi-6552 fs16 
fs28 fi-6552 + (NSCalendarDate *)b dateWithString:b0 (NSString *)i description
s9 li7030 fi-6553 fi-5796 i0 b calendarFormat:b0 (NSString *)i formati0 tab  Returns an NSCalendarDate object initialized with the date specified in i descriptioni0  and interpreted according the the conversion specifiers in i formati0 . Raises NSInvalidArgumentException if the i descriptioni0  and i formati0  do not correspond exactly.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSCalendarDate *)b dateWithString:b0 (NSString *)i descriptioni0  
s9 li7030 fi-6553 fi-5796 b calendarFormat:b0 (NSString *)i formati0  tab Returns an NSCalendarDate object initialized with the date
b locale:b0 (NSDictionary *)i dictionarytab tab i0 date specified in i descriptioni0  and interpreted according the the conversion specifiers in i formati0 . String components of the date are fetched from the locale i dictionaryi0 . Raises NSInvalidArgumentException if the i descriptioni0  and i formati0  do not correspond exactly.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSCalendarDate *)b dateWithYear:b0 (int)i yeari0 tab Returns an NSCalendarDate object initialized with integers 
s9 li7030 fi-6553 fi-5796 b month:b0 (unsigned int)i monthi0 tab tab that specify a i yeari0  (which must include the 
b day:b0 (unsigned int)i dayi0 tab tab century), i monthi0 , i dayi0 , i houri0 , i minutei0 , and i secondi0 . Also
b hour:b0 (unsigned int)i houri0 tab tab include a time-zone object or time-zone detail object 
b minute:b0 (unsigned int)i minutei0 tab tab (i aTimeZonei0 ) to have the date adjusted to a particular
b second:b0 (unsigned int)i secondi0 tab tab locale. If you specify b nilb0  for a time zone, 
b timeZoneb0 :(NSTimeZone *)i aTimeZonetab tab i0 NSInvalidArgumentException is raised.i  i0 (See "Retrieving Date Elements," below, for the proper ranges of the date and time integers.)
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b initWithString:b0 (NSString *)i descriptioni0 tab Initializes and returns an NSCalendarDate object specified by i descriptioni0  in the international format for date representation (YYYY-MM-DD HH:MM:SS f3 {f3 -}f1  HHMM, where f3 {f3 -}f1  HHMM is an offset from GMT).
fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b initWithString:b0 (NSString *)i descriptioni0 tab Initializes and returns an NSCalendarDate object specified
s9 li7030 fi-6553 fi-5796 b calendarFormat:b0 (NSString *)i formati0 tab tab as a string object in i descriptioni0  and interpreted according to the extended b strftime() b0 date-conversion specifiers in i formati0 . Raises NSInvalidArgumentException if the i descriptioni0  and i formati0  do not correspond exactly.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b initWithString:b0 (NSString *)i descriptioni0 tab Initializes and returns an NSCalendarDate object specified
s9 li7030 fi-6553 fi-5796 b calendarFormat:b0 (NSString *)i formati0 tab tab as a string object in i descriptioni0  and interpreted
b locale:b0 (NSDictionary *)i dictionaryi0 tab tab according to the extended b strftime b0 date-conversion specifiers in i formati0 . String components of the date are fetched from the locale i dictionaryi0 . Raises an NSInvalidArgumentException if the i descriptioni0  and i formati0  do not correspond exactly.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b initWithYear:b0 (int)i yeari0 tab Returns an NSCalendarDate object initialized with integers
s9 li7030 fi-6553 fi-5796 b month:b0 (unsigned int)i monthi0 tab tab that specify a i yeari0  (which must include the
b day:b0 (unsigned int)i dayi0 tab tab century), i monthi0 , i dayi0 , i houri0 , i minutei0 , and i secondi0 . Also
b hour:b0 (unsigned int)i houri0 tab tab include a time-zone object (i aTimeZonei0 ) to have the
b minute:b0 (unsigned int)i minutei0 tab tab date adjusted for a particular locale. Raises an 
b second:b0 (unsigned int)i secondi0 tab tab NSInvalidArgumentException if you specify b nilb0  for a 
b timeZoneb0 :(NSTimeZone *)i aTimeZonei0 tab tab time zone. (See "RetrievingDate Elements," below, for the proper ranges of the date and time integers.)
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Retrieving Date Elements
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (int)b dayOfCommonErab0 tab Returns the number of days since the beginning of the Common Era.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b dayOfMonthb0 tab Returns the day of the month (1 through 31) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b dayOfWeekb0 tab Returns a number indicating the day of the week (0 [Sun] through 6 [Sat]) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b dayOfYearb0 tab Returns a number indicating the day of the year (1 through 366) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b hourOfDayb0 tab Returns a number indicating the hour of the day (0 through 23) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b minuteOfHourb0 tab Returns a number indicating the minute of the hour (0 through 59) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b monthOfYearb0 tab Returns a number indicating the month of the year (1 through 12) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b secondOfMinuteb0 tab Returns a number indicating the second of the minute (0 through 59) of the NSCalendarDate object.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b yearOfCommonErab0 tab Returns a number indicating the year, including the century, of the NSCalendarDate object.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Providing Adjusted Dates 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSCalendarDate *)b addYear:b0 (int)i yeari0 tab Returns an NSCalendarDate objects with the i yeari0 , i monthi0 , 
s9 li7030 fi-6553 fi-5796 b month:b0 (int)i monthi0 tab tab i dayi0 , i houri0 , i minutei0 , and i secondi0  offsets specified as 
b day:b0 (int)i dayi0 tab tab arguments and the correct time-zone detail object for
b hour:b0 (int)i houri0 tab tab the computed date. These offsets are relative to the
b minute:b0 (int)i minutei0 tab tab object and can be positive or negative. This method
b second:b0 (int)i secondi0 tab tab preserves 'aaclock time'ba during transitions to and from 
tab tab Daylight Savings Time and on leap years.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Getting String Descriptions of Dates 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSString *)b descriptionb0 tab Returns a string description of the receiver'27s date using the default format string (%Y-%m-%d %H:%M:%S %z) and the locale and time-zone information associated with the receiver.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b descriptionWithCalendarFormat:b0 (NSString *)i formati0 tab 
s9 li7030 fi-6553 fi-5796 tab Returns a string description of the receiver'27s date that is formatted according to the conversion specifiers in i formati0  and using the locale and time-zone detail information associated with the receiver.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b descriptionWithCalendarFormat:b0 (NSString *)i formati0 tab 
s9 li7030 fi-6553 fi-5796 b locale:b0 (NSDictionary *)i localei0 tab Returns a string description of the receiver'27s date that is formatted according to the conversion specifiers in i formati0 , represented according to the locale information in i localei0 , and adjusted according to the time-zone detail information associated with the receiver.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b descriptionWithLocale:b0 (NSDictionary *)i locale
s9 li7030 fi-6553 fi-5796 i0 tab Returns a string description of the receiver'27s date using the default format string (%Y-%m-%d %H:%M:%S %z), with information localized according to the locale information in i localei0 , and using the time zone information associated with the receiver. 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Getting and Setting Calendar Formats 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSString *)b calendarFormatb0 tab Returns the calendar format (a string of date-conversion specifiers) for the receiving object. The default calendar format is 'aa%Y-%m-%d %H:%M:%S %z'ba.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setCalendarFormat:b0 (NSString *)i formattab i0 Sets the calendar format for the receiving object to i formati0 . 
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Getting and Setting Time Zones 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b setTimeZone:b0 (NSTimeZone *)i aTimeZonei0 tab Sets the time-zone object associated with the NSCalendarDate object to i aTimeZonei0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSTimeZoneDetail *)b timeZoneDetailb0 tab Returns the NSTimeZoneDetail object associated with the receiver.
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.