Re: UNIX DATE
Re: UNIX DATE
- Subject: Re: UNIX DATE
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 25 Apr 2004 09:38:40 -0700
On 4/25/04 8:08 AM, "Nigel Garvey" <email@hidden>
wrote:
>
Paul Berkowitz wrote on Sat, 24 Apr 2004 16:33:22 -0700:
>
>
> set s to ((date "Friday, December 24, 2004 3:00:00 PM") - (date "Thursday,
>
> January 1, 1970 12:00:00 AM"))
>
> set s to my Stringify(s)
>
> do shell script "date -ur " & s & " \"+ %F %T\""
>
> --> "2004-12-24 15:00:00"
>
>
It gives " F 15:00:00" on my machine. Changing the last line as follows
>
seems to work, though:
>
>
do shell script "date -ur " & s & " \"+%Y-%m-%d %T\""
Which OS? When you check 'man strftime' in Terminal, there's no "%F" listed?
%F is equivalent to ``%Y-%m-%d''
is here in OS 10.3.3. It's true that the date at the bottom is Jan 4, 2003.
It also says:
STANDARDS
The strftime() function conforms to ISO/IEC 9899:1990 (``ISO C89'')
with
a lot of extensions including `%C', `%D', `%E*', `%e', `%G', `%g',
`%h',
`%k', `%l', `%n', `%O*', `%R', `%r', `%s', `%T', `%t', `%u', `%V',
`%z',
`%+'.
The peculiar week number and year in the replacements of `%G', `%g' and
`%V' are defined in ISO 8601: 1988.
No mention of %F there. But also no mention of strftime having been revised
recently.
man date says:
An operand with a leading plus (``+'') sign signals a user-defined format
string which specifies the format in which to display the date and
time.
The format string may contain any of the conversion specifications
described in the strftime(3) manual page, as well as any arbitrary
text.
I'm going to assume that you must be in Jaguar. Does anyone know what got
changed (the version of BSD, perhaps?) in Panther, or at some other point?
--
Paul Berkowitz
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.