0

アイルランドの現在の四半期を AppleScript の変数として設定する必要があります。この四半期を生成する方法がわかりません。

何か案が?

乾杯

-- January / February / March = 1Q
-- April / May / June = 2Q
-- July / August / September = 3Q
-- October / November / December = 4Q
4

1 に答える 1

1

ということですか

set currentMonth to month of (current date) as integer
set currentQuarter to (((currentMonth - 1) div 3 + 1) as text) & "Q"

編集:または、タイムゾーンの設定を含む AppleScriptObjC バージョン

use framework "Foundation"

set currentCalendar to current application's NSCalendar's currentCalendar()
set dublinTimeZone to current application's NSTimeZone's timeZoneWithName:"Europe/Dublin"
set currentCalendar's timeZone to dublinTimeZone
set currentMonth to (currentCalendar's component:(current application's NSCalendarUnitMonth) fromDate:(current application's NSDate's |date|)) as integer
set currentQuarter to (((currentMonth - 1) div 3 + 1) as text) & "Q"
于 2016-04-09T10:35:54.400 に答える