This is NSTimeZone.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. s8 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSTimeZone pard s21 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject fs20 fs28 s12 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding, NSCopying fi0 NSObject (NSObject) fs20 fs28 s13 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 Foundation/NSDate.h fs20 fs28 pard s35 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s2 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 NSTimeZone is an abstract class that defines the behavior of time-zone objects. By itself, NSDate represents dates as i universal timei0 . Universal time treats a date and time value as identical in, for instance, Redwood City and New York City. NSDate has no provision for locale adjustment of time-zone information. Provision for locale is critical for string descriptions and other expressions of conventional dates and times. NSTimeZone is used to affect the apparent value of date objects so that they reflect time zone related locale information. fs16 fs28 NSTimeZoneDetail, a public subclass of NSTimeZone, augments the behavior of NSTimeZone by providing the commonly known attributes of a time zone in effect for a date within a time zone geopolitical area. These attributes are abbreviation, the offset from GMT (universal time), and an indication of whether Daylight Savings Time is in effect. fs16 fs28 Time-zone objects represent geopolitical regions and use names to denote the various regions. For example, 'aaUS/Pacific'ba identifies the geopolitical time zone for San Francisco and Los Angeles, which falls in the same general latitude as that for the time zone 'aaCanada/Pacific.'ba The US/Pacific time-zone has specific NSTimeZoneDetail instances that specify PST (Pacific Standard Time) and PDT (Pacific Daylight Time), which have slightly different offsets from GMT. fs16 fs28 You typically associate the objects returned by NSTimeZone (and, by extension, NSTimeZoneDetail) with date objects to affect their behavior. Time-zone objects can be of various types: fs16 fs28 pard s4 li1231 fi-376 ri1007 ql tx1231 tx2872 tx3250 'b7tab time zones with hour and minute offsets from Greenwich Mean Time (GMT) fs16 fs28 'b7tab time zones with a single abbreviation and offset fs16 fs28 'b7tab time zones that vary according to Standard Time and Daylight Savings Time fs16 fs28 pard s2 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 The system should supply the various choices for time zones along with time-zone information. These choices should be restricted to subsets based on latitude. You can access these choices through the b timeZoneArrayb0 class method. Another restriction is the choice of time zone available when there is an ambiguous abbreviation; these choices are available through the class method b abbreviationDictionaryb0 . Despite these restrictions, you can obtain an NSTimeZone object from an arbitrary file through the class method b timeZoneWithNameb0 . fs16 fs28 pard s30 li477 fi0 ri1007 ql f0 b fs24 Note: b0 fs28 f1 By itself, the NSTimeZone class only i namesi0 a time zone. It does not associate an abbreviation or a temporal offset with a time zone; that is done by NSTimeZoneDetail. An instance of NSTimeZone, however, 'aaknows'ba about the set of time-zone detail objects related to it. fs14 fs28 pard s2 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 fs2 fs28 NSTimeZone provides several class methods to get time-zone objects, with or without detail: b timeZoneWithName:b0 , b timeZoneWithAbbreviation:b0 , and b timeZoneForSecondsFromGMT:b0 . The class also permits you to set the default time zone used by your application for your locale (b setDefaultTimeZone:b0 ) You can access this default time zone at any time by the b defaultTimeZoneb0 method, and, with the b localTimeZoneb0 class method, you can also get a relative time-zone object that will decode itself to become the default time zone for any locale in which it finds itself. fs16 fs28 NSCalendarDate methods return date objects that are automatically bound with time-zone detail objects. These date objects use the functionality of NSTimeZone to adjust dates for the proper locale. Unless you specify otherwise, objects returned from NSCalendarDate are bound to the default time zone for the current locale. A useful instance method is b timeZoneDetailForDate:b0 , which returns a time-zone detail object associated with a specific date. fs16 fs28 pard s35 li100 fi0 ri1007 ql f0 b fs24 fs28 Creating and Initializing an NSTimeZone fs14 fs28 pard s14 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSTimeZoneDetail *)b defaultTimeZoneb0 tab Returns the default time zone as set for the current locale. fi-6552 fs16 fs28 fi-6552 + (NSTimeZone *)b localTimeZoneb0 tab Returns an NSTimeZone that behaves as the current default time zone in any given locale. fi-6552 fs16 fs28 fi-6552 + (NSTimeZone *)b timeZoneForSecondsFromGMT:b0 (int)i secondsi0 tab s16 li7030 fi-6553 fi-5796 tab Returns an NSTimeZone representing the time zone with i secondsi0 offset from Greenwich Mean Time. fs28 If there is no object matching the offset, this method creates and returns a newfs28 NSTimeZonefs28 bearing the value i secondsi0 as a name. s14 li7029 fi-5794 fi-6552 fs28 fs16 fs28 fi-6552 + (NSTimeZoneDetail *)b timeZoneWithAbbreviation:b0 (NSString *)i abbreviation s16 li7030 fi-6553 fi-5796 i0 tab Returns the time-zone object identified by the abbreviation i abbreviationi0 . If there'27s no match, this method returns b nilb0 . s14 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 + (NSTimeZone *)b timeZoneWithName:b0 (NSString *)i aTimeZoneName s16 li7030 fi-6553 fi-5796 i0 tab Returns the time-zone object with the name that corresponds to the geopolitical region i aTimeZoneNamei0 . It searches the regions dictionary for matching names. If there is no match on the name, this method returns b nilb0 . s14 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (NSTimeZoneDetail *)b timeZoneDetailForDate:b0 (NSDate *)i date s16 li7030 fi-6553 fi-5796 i0 tab Returns the correct time-zone detail object associated with a date object. You invoke this method when a region'27s time zone (that is, its offset value from GMT) varies over the year, as happens between Standard Time and Daylight Savings Time. pard s35 li100 fi0 ri1007 ql f0 b fs48 fs28 Managing Time Zones fs14 fs28 pard s14 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (void)b setDefaultTimeZone:b0 (NSTimeZone *)i aTimeZone s16 li7030 fi-6553 fi-5796 i0 tab Sets i aTimeZonei0 as the time zone appropriate for the current locale. This new time zone replaces the previous default time zone. pard s35 li100 fi0 ri1007 ql f0 b fs48 fs28 Getting Time Zone Information fs14 fs28 pard s14 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSDictionary *)b abbreviationDictionaryb0 tab Returns a dictionary that maps abbreviations to region names, for example 'aaPST'ba is the key for 'aaUS/Pacific'ba. If you know a region name for a key, you can obtain a valid abbreviation from the dictionary and use it to obtain a detail time-zone object using b timeZoneWithAbbreviation:b0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (NSString *)b timeZoneNameb0 tab Returns the fs28 geopoliticalfs28 name of the time zone. pard s35 li100 fi0 ri1007 ql f0 b fs48 fs28 Getting Arrays of Time Zones fs14 fs28 pard s14 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSArray *)b timeZoneArrayb0 tab Returns an array of string object arrays, each containing strings that show current geopolitical names for each time zone. The subarrays are grouped by latitudinal region. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSArray *)b timeZoneDetailArrayb0 tab Returns an array of NSTimeZoneDetail objects that are associated with the receiving NSTimeZone object. fi-6552 fs16 fs28 fi-6552 }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.