« FirstPROOF | トップページ | バーコード/2次元コード eラーニング »

[date]AppleScriptsで日付を求める

do shell scriptを使った方が簡単か?

tell current application
current date
--> date "201194日日曜日 17:56:38"
do shell script "date"
--> "Sun Sep 4 17:56:38 JST 2011"
do shell script "date +%D"
--> "09/04/11"
do shell script "date +%F"
--> "2011-09-04"
do shell script "date +%y%m%d"
--> "110904"
do shell script "date +%Y%m%d"
--> "20110904"
do shell script "date +%Y"
--> "2011"
do shell script "date +%y"
--> "11"
do shell script "date +%m"
--> "09"
do shell script "date +%B"
--> "September"
do shell script "date +%b"
--> "Sep"
do shell script "date +%d"
--> "04"
do shell script "date +%e"
--> " 4"
do shell script "date +%p"
--> "PM"
do shell script "date +%H"
--> "17"
do shell script "date +%I"
--> "05"
do shell script "date +%M"
--> "56"
do shell script "date +%S"
--> "38"
end tell
set theDate to my (current date)



set y to (year of theDate) as number
set m to (month of theDate) as number
set d to day of theDate as number
set ho to hours of theDate as number
set mi to minutes of theDate as number
set se to seconds of theDate as number

|

« FirstPROOF | トップページ | バーコード/2次元コード eラーニング »

AppleScript」カテゴリの記事

トラックバック


この記事へのトラックバック一覧です: [date]AppleScriptsで日付を求める:

« FirstPROOF | トップページ | バーコード/2次元コード eラーニング »