Up

NSTimeZone class reference

Authors

Yoo C. Chung (wacko@laplace.snu.ac.kr)
Richard Frith-Macdonald (rfm@gnu.org)

Version: 1.59

Date: 2004/02/08 09:42:38

Copyright: (C) 1997-2002 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSTimeZone class
  2. Software documentation for the NSTimeZoneDetail class

Software documentation for the NSTimeZone class

NSTimeZone : NSObject

Declared in:
Foundation/NSTimeZone.h
Standards:

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).

Method summary

abbreviationDictionary

+ (NSDictionary*) abbreviationDictionary;

Description forthcoming.


abbreviationMap

+ (NSDictionary*) abbreviationMap;

Description forthcoming.


defaultTimeZone

+ (NSTimeZone*) defaultTimeZone;

Return the default time zone for this process.


localTimeZone

+ (NSTimeZone*) localTimeZone;

Return a proxy to the default time zone for this process.


resetSystemTimeZone

+ (void) resetSystemTimeZone;

Destroy the system time zone so that it will be recreated next time it is used.


setDefaultTimeZone:

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

Set the default time zone to be used for this process.


systemTimeZone

+ (NSTimeZone*) systemTimeZone;

Returns the current system time zone for the process.


timeZoneArray

+ (NSArray*) timeZoneArray;

Description forthcoming.


timeZoneForSecondsFromGMT:

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

Return a timezone for the specified offset from GMT.
The timezone returned does not use daylight savings time. The actual timezone returned has an offset rounded to the nearest minute.
Time zones with an offset of more than +/- 18 hours are disallowed, and nil is returned.


timeZoneWithAbbreviation:

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

Returns a timezone for the specified abbrevition,


timeZoneWithName:

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

Returns a timezone for the specified name.


timeZoneWithName:data:

+ (NSTimeZone*) timeZoneWithName: (NSString*)name data: (NSData*)data;

Returns a timezone for the specified name, created from the supplied data.


abbreviation

- (NSString*) abbreviation;

Returns the abbreviation for this timezone now. Invokes -abbreviationForDate:


abbreviationForDate:

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

Returns the abbreviation for this timezone at aDate. This may differ depending on whether daylight savings time is in effect or not.


data

- (NSData*) data;

Returns the data with which the receiver was initialised.


initWithName:

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

Initialise a timezone with the supplied name. May return a cached timezone object rather than the newly created one.


initWithName:data:

- (id) initWithName: (NSString*)name data: (NSData*)data;

Initialises a time zone object using the supplied data object.
This method is intended for internal use by the NSTimeZone class cluster. Don't use it... use -initWithName: instead.


isDaylightSavingTime

- (BOOL) isDaylightSavingTime;

Returns a boolean indicating whether daylight savings time is in effect now. Invokes -isDaylightSavingTimeForDate:


isDaylightSavingTimeForDate:

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

Returns a boolean indicating whether daylight savings time is in effect for this time zone at aDate.


isEqualToTimeZone:

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

Description forthcoming.


name

- (NSString*) name;

Description forthcoming.


secondsFromGMT

- (int) secondsFromGMT;

Returns the number of seconds by which the receiver differs from Greenwich Mean Time at the current date and time.
Invokes -secondsFromGMTForDate:


secondsFromGMTForDate:

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

Returns the number of seconds by which the receiver differs from Greenwich Mean Time at the date aDate.
If the time zone uses dayl;ight savings time, the returned value will vary at different times of year.


timeZoneDetailArray

- (NSArray*) timeZoneDetailArray;

Description forthcoming.


timeZoneDetailForDate:

- (NSTimeZoneDetail*) timeZoneDetailForDate: (NSDate*)date;

Description forthcoming.


timeZoneName

- (NSString*) timeZoneName;

Description forthcoming.


Software documentation for the NSTimeZoneDetail class

NSTimeZoneDetail : NSTimeZone

Declared in:
Foundation/NSTimeZone.h
Standards:

This class serves no useful purpose in GNUstep, and is provided solely for backward compatibility with the OpenStep spec. It is missing entirely from MacOS-X.

Method summary

isDaylightSavingTimeZone

- (BOOL) isDaylightSavingTimeZone;

Description forthcoming.


timeZoneAbbreviation

- (NSString*) timeZoneAbbreviation;

Description forthcoming.


timeZoneSecondsFromGMT

- (int) timeZoneSecondsFromGMT;

Description forthcoming.



Up