Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

NSTimeZoneMBS.abbreviationDictionary as Dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 13.4 Yes No No Yes, macOS only No
Function: Returns a dictionary holding the mappings of time zone abbreviations to time zone names.
Notes:
Note that more than one time zone may have the same abbreviation—for example, US/Pacific and Canada/Pacific both use the abbreviation "PST." In these cases, abbreviationDictionary chooses a single name to map the abbreviation to.
(Read and Write computed property)

Feedback, Comments & Corrections

NSTimeZoneMBS.defaultTimeZone as NSTimeZoneMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.3 Yes No No Yes, macOS only No
Function: Returns the default time zone for the current application.
Example:
MsgBox NSTimeZoneMBS.defaultTimeZone.name
Notes:
The default time zone for the current application. If no default time zone has been set, this method invokes systemTimeZone and returns the system time zone.

Discussion
The default time zone is the one that the application is running with, which you can change (so you can make the application run as if it were in a different time zone).

If you get the default time zone and hold onto the returned object, it does not change if a subsequent invocation of setDefaultTimeZone changes the default time zone—you still have the specific time zone you originally got. Contrast this behavior with the object returned by localTimeZone.

Feedback, Comments & Corrections

NSTimeZoneMBS.knownTimeZoneNames as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 13.4 Yes No No Yes, macOS only No
Function: Returns an array of strings listing the IDs of all the time zones known to the system.
Example:
MsgBox join(NSTimeZoneMBS.knownTimeZoneNames, EndOfLine)

Feedback, Comments & Corrections

NSTimeZoneMBS.localTimeZone as NSTimeZoneMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.3 Yes No No Yes, macOS only No
Function: Returns an object that forwards all messages to the default time zone for the current application.
Example:
MsgBox NSTimeZoneMBS.localTimeZone.name
Notes:
An object that forwards all messages to the default time zone for the current application.

Discussion
The local time zone represents the current state of the default time zone at all times. If you get the default time zone (using defaultTimeZone) and hold onto the returned object, it does not change if a subsequent invocation of setDefaultTimeZone changes the default time zone—you still have the specific time zone you originally got. The local time zone adds a level of indirection, it acts as if it were the current default time zone whenever you invoke a method on it.

Feedback, Comments & Corrections

NSTimeZoneMBS.systemTimeZone as NSTimeZoneMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 12.3 Yes No No Yes, macOS only No
Function: Returns the time zone currently used by the system.
Example:
MsgBox NSTimeZoneMBS.systemTimeZone.name
Notes:
The time zone currently used by the system. If the current time zone cannot be determined, returns the GMT time zone.

Special Considerations
If you get the system time zone, it is cached by the application and does not change if the user subsequently changes the system time zone. The next time you invoke systemTimeZone, you get back the same time zone you originally got. You have to invoke resetSystemTimeZone to clear the cached object.

Feedback, Comments & Corrections

NSTimeZoneMBS.timeZoneForSecondsFromGMT(seconds as Integer) as NSTimeZoneMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 17.5 Yes No No Yes, macOS only No
Function: Creates time zone object based on a delta from GMT.
Notes: Time zones created with this never have daylight savings and the offset is constant no matter the date; the name and abbreviation do NOT follow the POSIX convention (of minutes-west).

Feedback, Comments & Corrections

NSTimeZoneMBS.timeZoneWithName(name as string) as NSTimeZoneMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Cocoa MBS MacBase Plugin 13.4 Yes No No Yes, macOS only No
Function: Returns the time zone object identified by a given ID.
Example:
dim t as NSTimeZoneMBS = NSTimeZoneMBS.timeZoneWithName("Europe/Berlin")
MsgBox t.name
Notes:
Name: The ID for the time zone.

Returns the time zone in the information directory with a name matching name.
Returns nil if there is no match for the name.

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins