Re: ISO time "class"
Re: ISO time "class"
- Subject: Re: ISO time "class"
- From: Doug McNutt <email@hidden>
- Date: Sun, 23 Dec 2007 18:50:05 -0700
At 20:33 +0000 12/23/07, has wrote:
>Might I suggest that strptime/strftime-style commands for converting dates to strings and vice-versa according to a user-supplied format string would be a more useful request?
>
>As for date handling in general, the real problem is the standard typeLongDateTime type used to pass date info between AppleScript and scriptable applications. It's long past time this was deprecated in favour of a timezone-aware date/time type.
>
>has
>--
>http://appscript.sourceforge.net
>http://rb-appscript.rubyforge.org
I find this useful for creating time strings that work for RFC2822 email. It's likely that the underlying UNIX/POSIX libraries are something like a standard that is widely accepted.
osascript <<ENDSCRIPT
set rightnow to do shell script "date \\"+%a, %d %b %Y %H:%M:%S %z\\""
rightnow
ENDSCRIPT
See:
man date
man 3 strftime
for fun reading and a large array of formatting options.
As for passing date and time to anther application on the same machine or at least on a local network the UNIX seconds since the start of 1970 UT is so simple that the complexity of day name and the like should be avoided.
Well . . . Microsoft Excel's dates, with their use of floating point days away from an epoch, might be better, but Excel refuses to accept negative times so the paleontologists and genealogists among us are frustrated. Sigh.
--
--> I wonder what life would be like if we used base 9, candles on a Menorah, instead of base 10? <--
_______________________________________________
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