Re: Do shell script "date" vs current date
Re: Do shell script "date" vs current date
- Subject: Re: Do shell script "date" vs current date
- From: bill <email@hidden>
- Date: Tue, 12 Mar 2002 17:15:25 +0800
>
At 8:38 -0700 3/11/2002, garbanzito wrote:
>
> however even just the shell's date command has some options
>
> that might be hard to reproduce with current date.
Thanks for your reply, Steve.
You are right, like month number, weekday in number, or format independent
from user setting.
Set timeStamp to do shell script "date +%Y%m%d%H%M%S"
-- "20020312165257"
Which is suitable for rename file.
Well, let's share what I find, the full description is in this link:
http://www.tac.eu.org/cgi-bin/man-cgi?strftime+3
-- similar options are grouped together, separated by hyphen.
-- ISO 8601
-- YYYY-MM-DD
do shell script "date +%Y-%m-%d" -- "2002-03-09"
-- hh:mm:ss
do shell script "date +%X" -- "23:49:07"
-- YYYYMMDD & "T" & hhmmss
do shell script "date +%Y%m%dT%H%M%S" -- "20020309T235018"
-- year
do shell script "date +%Y-%y" -- "2002-02"
-- month
do shell script "date +%B-%b-%h-%m" -- "March-Mar-Mar-03"
-- day of month
do shell script "date +%d-%e" -- "12-12"
-- day of year
do shell script "date +%j" -- "071"
-- week number, %U Monday first, %W Sunday first
do shell script "date +%U-%W" -- "10-10"
-- weekday
do shell script "date +%A-%a-%w" -- "Tuesday-Tue-2"
-- date / time in full
do shell script "date +%C" -- "Tue Mar 12 16:35:20 2002"
do shell script "date +%c" -- "03/12/02 16:35:41"
do shell script "date +%D" -- "03/12/02"
do shell script "date +%x" -- "03/12/02"
do shell script "date +%X" -- "16:42:33"
do shell script "date +%T" -- "16:42:33"
do shell script "date +%r" -- "04:43:09 PM"
do shell script "date +%R" -- "16:42"
-- hour (24-hour clock)
do shell script "date +%H-%k" -- "16-16"
-- hour (12-hour clock)
do shell script "date +%I-%l" -- "04- 4"
-- minute
do shell script "date +%M" -- "47"
-- second
do shell script "date +%S" -- "25"
-- second since Epoch, UCT
do shell script "date +%s" -- "1015922859"
-- name of time zone
do shell script "date +%Z" -- "CST"
-- locales AM or PM
do shell script "date +%p" -- "PM"
-- control character : %n : new line, %t : tab, %% : %
-- unsupported : %G, %g, %u, %V
Bye
Bill :(
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.