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

CFTimeZone provides several functions to create time zone objects: CFTimeZoneCreateWithName(_:_:_:) and CFTimeZoneCreateWithTimeIntervalFromGMT(_:_:). CFTimeZone also permits you to set the default time zone within your application using the CFTimeZoneSetDefault(_:) function. You can access this default time zone at any time with the CFTimeZoneCopyDefault() function.

CFTimeZone is “toll-free bridged” with its Cocoa Foundation counterpart, NSTimeZone. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSTimeZone * parameter, you can pass in a CFTimeZoneRef, and in a function where you see a CFTimeZoneRef parameter, you can pass in an NSTimeZone instance. This fact also applies to concrete subclasses of NSTimeZone. See Toll-Free Bridged Types for more information on toll-free bridging.


Creating a Time Zone

func CFTimeZoneCreateWithName(CFAllocator!, CFString!, Bool)

Returns the time zone object identified by a given name or abbreviation.

func CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocator!, CFTimeInterval)

Returns a time zone object for the specified time interval offset from Greenwich Mean Time (GMT).

func CFTimeZoneCreate(CFAllocator!, CFString!, CFData!)

Creates a time zone with a given name and data.

System and Default Time Zones and Information

func CFTimeZoneCopyAbbreviationDictionary()

Returns a dictionary holding the mappings of time zone abbreviations to time zone names.

func CFTimeZoneCopyAbbreviation(CFTimeZone!, CFAbsoluteTime)

Returns the abbreviation of a time zone at a specified date.

func CFTimeZoneCopyDefault()

Returns the default time zone set for your application.

func CFTimeZoneCopySystem()

Returns the time zone currently used by the system.

func CFTimeZoneSetDefault(CFTimeZone!)

Sets the default time zone for your application the given time zone.

func CFTimeZoneCopyKnownNames()

Returns an array of strings containing the names of all the time zones known to the system.

func CFTimeZoneResetSystem()

Clears the previously determined system time zone, if any.

func CFTimeZoneSetAbbreviationDictionary(CFDictionary!)

Sets the abbreviation dictionary to a given dictionary.

Getting Information About Time Zones

func CFTimeZoneGetName(CFTimeZone!)

Returns the geopolitical region name that identifies a given time zone.

func CFTimeZoneGetSecondsFromGMT(CFTimeZone!, CFAbsoluteTime)

Returns the difference in seconds between the receiver and Greenwich Mean Time (GMT) at the specified date.

func CFTimeZoneGetData(CFTimeZone!)

Returns the data that stores the information used by a time zone.

Getting Daylight Savings Time Information

func CFTimeZoneIsDaylightSavingTime(CFTimeZone!, CFAbsoluteTime)

Returns whether or not a time zone is in daylight savings time at a specified date.

func CFTimeZoneGetDaylightSavingTimeOffset(CFTimeZone!, CFAbsoluteTime)

Returns the daylight saving time offset for a time zone at a given time.

func CFTimeZoneGetNextDaylightSavingTimeTransition(CFTimeZone!, CFAbsoluteTime)

Returns the time in a given time zone of the next daylight saving time transition after a given time.

Getting the CFTimeZone Type ID

func CFTimeZoneGetTypeID()

Returns the type identifier for the CFTimeZone opaque type.

Data Types


Index type for constants used to specify styles of time zone names.


A reference to a CFTimeZone object.


Notification Name

Name of the notification posted when the time zone changes.

Time Zone Name Styles

Constants to specify styles for time zone names.