CFTimeZone

Overview

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.

Topics

Creating a Time Zone

CFTimeZoneCreateWithName

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

CFTimeZoneCreateWithTimeIntervalFromGMT

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

CFTimeZoneCreate

Creates a time zone with a given name and data.

System and Default Time Zones and Information

CFTimeZoneCopyAbbreviationDictionary

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

CFTimeZoneCopyAbbreviation

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

CFTimeZoneCopyDefault

Returns the default time zone set for your application.

CFTimeZoneCopySystem

Returns the time zone currently used by the system.

CFTimeZoneSetDefault

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

CFTimeZoneCopyKnownNames

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

CFTimeZoneResetSystem

Clears the previously determined system time zone, if any.

CFTimeZoneSetAbbreviationDictionary

Sets the abbreviation dictionary to a given dictionary.

Getting Information About Time Zones

CFTimeZoneGetName

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

CFTimeZoneCopyLocalizedName

Returns the localized name of a given time zone.

CFTimeZoneGetSecondsFromGMT

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

CFTimeZoneGetData

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

Getting Daylight Savings Time Information

CFTimeZoneIsDaylightSavingTime

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

CFTimeZoneGetDaylightSavingTimeOffset

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

CFTimeZoneGetNextDaylightSavingTimeTransition

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

Getting the CFTimeZone Type ID

CFTimeZoneGetTypeID

Returns the type identifier for the CFTimeZone opaque type.

Data Types

CFTimeZoneNameStyle

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

CFTimeZoneRef

A reference to a CFTimeZone object.

Constants

Notification Name

Name of the notification posted when the time zone changes.

Time Zone Name Styles

Constants to specify styles for time zone names.

See Also

Opaque Types

CFFileDescriptor

The CFFileDescriptor provides an opaque type to monitor file descriptors for read and write activity via CFRunLoop.

CFStringTokenizer

CFStringTokenizer allows you to tokenize strings into words, sentences or paragraphs in a language-neutral way. It supports languages such as Japanese and Chinese that do not delimit words by spaces, as well as de-compounding German compounds. You can obtain Latin transcription for tokens. It also provides language identification API.