NSTimeZoneのじっけん

NSTimeZoneについてのひととおりの(タイムゾーンの変更以外)メソッドを呼び出してテストしてみました。

AppleScript名:NSTimeZoneの実験
– Created 2015-08-27 by Takaaki Naganoya
– Piyomaru Software
use AppleScript version “2.4″
use scripting additions
use framework “Foundation”

set aTZ to current application’s NSTimeZone’s localTimeZone()
–>  (__NSLocalTimeZone) Local Time Zone (Asia/Tokyo (JST) offset 32400)

set aTZstr to aTZ’s |name|()
–>  (NSString) “Asia/Tokyo”

set aSecFromGMT to aTZ’s secondsFromGMT()
–>  32400

set a1Str to aTZ’s abbreviation()
–>  (NSString) “JST”

set a2Str to aTZ’s |description|()
–>  (NSString) “Local Time Zone (Asia/Tokyo (JST) offset 32400)”

set a3F to aTZ’s isDaylightSavingTime()
–>  false

set a4Num to aTZ’s daylightSavingTimeOffset()
–>  0.0

set a5Num to aTZ’s nextDaylightSavingTimeTransition()
–>  missing value

set bTZ to current application’s NSTimeZone’s systemTimeZone()
–>  (__NSTimeZone) Asia/Tokyo (JST) offset 32400

set cTZ to current application’s NSTimeZone’s timeZoneWithAbbreviation:“JST”
–>  (__NSTimeZone) Asia/Tokyo (JST) offset 32400

set dTZ to current application’s NSTimeZone’s timeZoneWithName:“Asia/Tokyo”
–>  (__NSTimeZone) Asia/Tokyo (JST) offset 32400

set aDat to current application’s NSTimeZone’s defaultTimeZone()’s |data|()
–>  (NSData) <545a6966 00000000 00000000 00000000 00000000 00000003 00000003 00000000 00000009 00000003 0000000d c3553b70 d73e1e90 d7ec1680 d8f91690 d9cbf880 db071d10 dbabda80 dce6ff10 dd8bbc80 02010201 02010201 0200007e 90000000 008ca001 0500007e 9000094a 43535400 4a445400 4a535400 00000000 0000>
set eTZ to (current application’s NSTimeZone’s timeZoneWithName:“Japan” |data|:aDat)’s |description|()
–>  (NSString) “Japan (JST) offset 32400″

set fTZ to current application’s NSTimeZone’s timeZoneForSecondsFromGMT:32400
–>  (__NSTimeZone) GMT+0900 (GMT+9) offset 32400

set gTZ to current application’s NSTimeZone’s alloc()’s initWithName:“JST”
–>  (__NSTimeZone) JST (JST) offset 32400

set hTZ to current application’s NSTimeZone’s alloc()’s initWithName:“JST” |data|:aDat
–>  (__NSTimeZone) JST (JST) offset 32400

set aVerStr to current application’s NSTimeZone’s timeZoneDataVersion()
–>  (NSString) “2015f”

set iTZ to current application’s NSTimeZone’s localTimeZone()
–>  (__NSLocalTimeZone) Local Time Zone (Asia/Tokyo (JST) offset 32400)

set jTZ to current application’s NSTimeZone’s defaultTimeZone()
–>  (__NSTimeZone) Asia/Tokyo (JST) offset 32400

set kTZ to current application’s NSTimeZone’s systemTimeZone()
–>  (__NSTimeZone) Asia/Tokyo (JST) offset 32400

set aDic to current application’s NSTimeZone’s abbreviationDictionary()
–>  (NSDictionary) {​​​​​EDT:”America/New_York”, ​​​​​GMT:”GMT”, ​​​​​AST:”America/Halifax”, ​​​​​IRST:”Asia/Tehran”, ​​​​​ICT:”Asia/Bangkok”, ​​​​​PET:”America/Lima”, ​​​​​KST:”Asia/Seoul”, ​​​​​PST:”America/Los_Angeles”, ​​​​​CDT:”America/Chicago”, ​​​​​EEST:”Europe/Istanbul”, ​​​​​NZDT:”Pacific/Auckland”, ​​​​​WEST:”Europe/Lisbon”, ​​​​​EAT:”Africa/Addis_Ababa”, ​​​​​HKT:”Asia/Hong_Kong”, ​​​​​IST:”Asia/Calcutta”, ​​​​​MDT:”America/Denver”, ​​​​​NZST:”Pacific/Auckland”, ​​​​​WIT:”Asia/Jakarta”, ​​​​​ADT:”America/Halifax”, ​​​​​BST:”Europe/London”, ​​​​​ART:”America/Argentina/Buenos_Aires”, ​​​​​CAT:”Africa/Harare”, ​​​​​GST:”Asia/Dubai”, ​​​​​PDT:”America/Los_Angeles”, ​​​​​SGT:”Asia/Singapore”, ​​​​​COT:”America/Bogota”, ​​​​​PKT:”Asia/Karachi”, ​​​​​EET:”Europe/Istanbul”, ​​​​​UTC:”UTC”, ​​​​​WAT:”Africa/Lagos”, ​​​​​EST:”America/New_York”, ​​​​​JST:”Asia/Tokyo”, ​​​​​CLST:”America/Santiago”, ​​​​​CET:”Europe/Paris”, ​​​​​BDT:”Asia/Dhaka”, ​​​​​MSK:”Europe/Moscow”, ​​​​​AKDT:”America/Juneau”, ​​​​​CLT:”America/Santiago”, ​​​​​AKST:”America/Juneau”, ​​​​​BRST:”America/Sao_Paulo”, ​​​​​BRT:”America/Sao_Paulo”, ​​​​​CEST:”Europe/Paris”, ​​​​​CST:”America/Chicago”, ​​​​​HST:”Pacific/Honolulu”, ​​​​​MSD:”Europe/Moscow”, ​​​​​MST:”America/Denver”, ​​​​​PHT:”Asia/Manila”, ​​​​​WET:”Europe/Lisbon”​​​}

set bDic to current application’s NSTimeZone’s knownTimeZoneNames()
–>  (NSArray) {​​​​​”Africa/Abidjan”, ​​​​​”Africa/Accra”, ​​​​​”Africa/Addis_Ababa”​​​​​….​​​}

★Click Here to Open This Script 

Leave a Reply