[Previous] [Up] [Next]

NSTimeZone

Authors

Richard Frith-Macdonald

Version: $Revision$

Date: $Date$

NSTimeZone

NSTimeZone

Declared in: Foundation/NSTimeZone.h

Inherits from: NSObject

Conforms to: NSCoding


If the GNUstep time zone datafiles become too out of date, one can download an updated database from ftp://elsie.nci.nih.gov/pub/ and compile it as specified in the README file in the NSTimeZones directory. Time zone names in NSDates should be GMT, MET etc. not Europe/Berlin, America/Washington etc. The problem with this is that various time zones may use the same abbreviation (e.g. Australia/Brisbane and America/New_York both use EST), and some time zones may have different rules for daylight saving time even if the abbreviation and offsets from UTC are the same. The problems with depending on the OS for providing time zone info are that some methods for the NSTimeZone classes might be difficult to implement, and also that time zone names may vary wildly between OSes (this could be a big problem when archiving is used between different systems).

Instance Variables

Methods


Class Methods

abbreviationDictionary

+ (NSDictionary*) abbreviationDictionary;

defaultTimeZone

+ (NSTimeZone*) defaultTimeZone;

localTimeZone

+ (NSTimeZone*) localTimeZone;

knownTimeZoneNames

+ (NSArray*) knownTimeZoneNames;

resetSystemTimeZone

+ (void) resetSystemTimeZone;

setDefaultTimeZone:

+ (void) setDefaultTimeZone: (NSTimeZone*)aTimeZone;

systemTimeZone

+ (NSTimeZone*) systemTimeZone;

timeZoneForSecondsFromGMT:

+ (NSTimeZone*) timeZoneForSecondsFromGMT: (int)seconds;

timeZoneWithAbbreviation:

+ (NSTimeZone*) timeZoneWithAbbreviation: (NSString*)abbreviation;

timeZoneWithName:

+ (NSTimeZone*) timeZoneWithName: (NSString*)aTimeZoneName;

timeZoneWithName:

+ (NSTimeZone*) timeZoneWithName: (NSString*)aTimeZoneName;


Instances Methods

abbreviation

- (NSString*) abbreviation;

abbreviationForDate:

- (NSString*) abbreviationForDate: (NSDate*)aDate;

data

- (NSData*) data;

description

- (NSString*) description;

initWithName:

- (id) initWithName: (NSString*)aName;

initWithName:

- (id) initWithName: (NSString*)aName;

isDaylightSavingTime

- (BOOL) isDaylightSavingTime;

isDaylightSavingTimeForDate:

- (BOOL) isDaylightSavingTimeForDate: (NSDate*)aDate;

isEqualToTimeZone:

- (BOOL) isEqualToTimeZone: (NSTimeZone*)aTimeZone;

name

- (NSString*) name;

secondsFromGMT

- (int) secondsFromGMT;

secondsFromGMTForDate:

- (int) secondsFromGMTForDate: (NSDate*)aDate;