Re: Simple Date-Time Format Question...
Re: Simple Date-Time Format Question...
- Subject: Re: Simple Date-Time Format Question...
- From: "Mark J. Reed" <email@hidden>
- Date: Wed, 25 Apr 2007 11:59:15 -0400
On 4/25/07, revDAVE <email@hidden> wrote:
This is good fun - I have never really used shell scripts before - is there
a URL I can read some information about them?
The best documentation for things like the format string to date is
the man page. Just type "man date" in a Terminal window. The full
list of format controls is there.
I tried to to get the year first but also wanted only 2 digit year - not a
4 digit year for my particular use... Like: "07-04-25 12-11-10 PM"
That will cause sorting issues if you ever have to deal with dates
from back before 2000, but it's easy to get - %y (note lowercase) is
the two-digit year.
Q: does %F - stand for full date?
In ISO-8601 format, yes. %F is exactly equivalent to %Y-%m-%d.
do shell script "date +'%F %H-%M-%S'"
Note that the official ISO time format uses colons instead of hyphens,
and can be obtained with the simple %T. The full ISO date/time stamp
is "date + '%FT%T'".
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden