Platforms to show: All Mac Windows Linux Cross-Platform

NSTimeZoneMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Cocoa MBS MacBase Plugin 12.3 Yes No No Yes, macOS only No
Function: NSTimeZone is an abstract class that defines the behavior of time zone objects.
Time zone objects represent geopolitical regions. Consequently, these objects have names for these regions. Time zone objects also represent a temporal offset, either plus or minus, from Greenwich Mean Time (GMT) and an abbreviation (such as PST for Pacific Standard Time).

NSTimeZone provides several class methods to get time zone objects: timeZoneWithName, timeZoneWithAbbreviation, and timeZoneForSecondsFromGMT. The class also permits you to set the default time zone within your application (setDefaultTimeZone). You can access this default time zone at any time with the defaultTimeZone class method, and with the localTimeZone class method, you can get a relative time zone object that decodes itself to become the default time zone for any locale in which it finds itself.

Cocoa does not provide any API to change the time zone of the computer, or of other applications.

Some NSCalendarDate methods return date objects that are automatically bound to time zone 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.

Note that, strictly, time zone database entries such as "America/Los_Angeles" are IDs not names. An example of a time zone name is "Pacific Daylight Time". Although many NSTimeZone method names include the word "name", they refer to IDs.

Feedback, Comments & Corrections

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Blog Entries

The items on this page are in the following plugins: MBS MacBase Plugin.

NSTimerMBS   -   NSTokenFieldMBS

The biggest plugin in space...

MBS Xojo Plugins