[date]AppleScriptsで日付を求める
do shell scriptを使った方が簡単か?
tell current application
current date
--> date "2011年9月4日日曜日 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
| 固定リンク
「AppleScript」カテゴリの記事
- 濁音 半濁音 置換用レコード(2023.08.21)
- [AppleScript]キーノートの書類サイズを指定して作成(2022.01.09)
- [awk]行頭のスペースを削除する(subで置き換え)(2021.11.16)
- [SpotLight]選択範囲でSpotLight検索(2021.11.03)
- [AppleScript]リソースフォーク(カスタムアイコン)削除(2021.10.12)


[RSS]