O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSTimeZone — Mac OS X 10.0

Synopsis

This class represents a time zone—objects that store information about a geographic time zone, such as the name, abbreviation, time from GMT, whether or not daylight savings is in effect, and so on.

NSTimeZone is toll-free bridged with the Core Foundation type CFTimeZone. As such, NSTimeZone objects can be used interchangeably with the CFTimeZone pointer type, CFTimeZoneRef.

image with no caption

@interface NSTimeZone : NSObject <NSCoding, NSCopying>
                                  // Initializers
   - (id)initWithName:(NSString *)tzName;
   - (id)initWithName:(NSString *)tzName 
                                 data:(NSData *)aData;
                                  // Class Methods
   + (NSDictionary *)abbreviationDictionary;
   + (NSTimeZone *)defaultTimeZone;
   + (NSArray *)knownTimeZoneNames;
   + (NSTimeZone *)localTimeZone;
   + (void)resetSystemTimeZone;
   + (void)setDefaultTimeZone:(NSTimeZone *)aTimeZone;
   + (NSTimeZone *)systemTimeZone;
   + (id)timeZoneForSecondsFromGMT:(int)seconds;
   + (id)timeZoneWithAbbreviation:(NSString *)abbreviation;
   + (id)timeZoneWithName:(NSString *)tzName;
   + (id)timeZoneWithName:(NSString *)tzName 
                                 data:(NSData *)aData;
                                  // Instance Methods
   - (NSString *)abbreviation;
   - (NSString *)abbreviationForDate:(NSDate *)aDate;
   - (NSData *)data;
   - (NSString *)description;
   - (BOOL)isDaylightSavingTime;
   - (BOOL)isDaylightSavingTimeForDate:(NSDate *)aDate;
   - (BOOL)isEqualToTimeZone:(NSTimeZone *)aTimeZone;
 - (NSString ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required