Re: Unixy question
Re: Unixy question
- Subject: Re: Unixy question
- From: garrett <email@hidden>
- Date: Sat, 18 May 2002 05:33:57 -0500
Sometime 'round 05/09/2002 12:08 AM, Paul Skinner at email@hidden
described:
>
Can someone translate this into the actual string I need to give to a
>
'do shell script' command to get the time with microseconds ?
>
I still feel like I'm reading a french textbook. I know all of these
>
words, but I can't seem to arrange them into meaningful sentences.
I think what u want more is like this:
set theMonth to do shell script "date +%m" as string
set theDate to do shell script "date +%d" as string
set theYear to "20" & (do shell script "date +%y" as string)
set theHour_24 to do shell script "date +%H" as string
set theMinute to do shell script "date +%M" as string
set theTime_long to do shell script "date +%r" as string
Heres a complete listing of all the calls:
man strftime
%A is replaced by the locale's full weekday name.
%a is replaced by the locale's abbreviated weekday name.
%B is replaced by the locale's full month name.
%b or %h
is replaced by the locale's abbreviated month name.
%C is replaced by the century (a year divided by 100 and truncated
to
an integer) as a decimal number (00-99).
%c is replaced by the locale's appropriate date and time representa-
tion.
%D is replaced by the date in the format ``%m/%d/%y''.
%d is replaced by the day of the month as a decimal number (01-31).
%e is replaced by the day of month as a decimal number (1-31);
single
digits are preceded by a blank.
%H is replaced by the hour (24-hour clock) as a decimal number
(00-23).
%I is replaced by the hour (12-hour clock) as a decimal number
(01-12).
%j is replaced by the day of the year as a decimal number (001-366).
%k is replaced by the hour (24-hour clock) as a decimal number
(0-23);
single digits are preceded by a blank.
%l is replaced by the hour (12-hour clock) as a decimal number
(1-12);
single digits are preceded by a blank.
%M is replaced by the minute as a decimal number (00-59).
%m is replaced by the month as a decimal number (01-12).
%n is replaced by a newline.
%p is replaced by the locale's equivalent of either ``AM'' or
``PM''.
%R is replaced by the time in the format ``%H:%M''.
%r is replaced by the locale's representation of 12-hour clock time
using AM/PM notation.
%T is replaced by the time in the format ``%H:%M:%S''.
%t is replaced by a tab.
%S is replaced by the second as a decimal number (00-60).
%s is replaced by the number of seconds since the Epoch, UCT (see
mktime(3)).
%U is replaced by the week number of the year (Sunday as the first
day
of the week) as a decimal number (00-53).
%u is replaced by the weekday (Monday as the first day of the week)
as
a decimal number (1-7).
%V is replaced by the week number of the year (Monday as the first
day
of the week) as a decimal number (01-53). If the week containing
January 1 has four or more days in the new year, then it is week
1;
otherwise it is week 53 of the previous year, and the next week
is
week 1.
%W is replaced by the week number of the year (Monday as the first
day
of the week) as a decimal number (00-53).
%w is replaced by the weekday (Sunday as the first day of the week)
as
a decimal number (0-6).
%X is replaced by the locale's appropriate time representation.
%x is replaced by the locale's appropriate date representation.
%Y is replaced by the year with century as a decimal number.
%y is replaced by the year without century as a decimal number
(00-99).
%Z is replaced by the time zone name.
%% is replaced by `%'.
-------
garrett
_______________________________________________
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.