On Tue, Sep 22, 2009 at 3:40 PM, Mark Lively <[log in to unmask]> wrote:
> set time_offset to do shell script "date -j 081011001992 +%s"
> do shell script "date -j -v-" & time_offset & "S +%s.html"
>
> Might even be faster.
Especially if you just hard-code the date_offset value rather than
shelling out to date to calculate it every time. (But note that it
isn't necessarily 713458800; it depends on the time zone in question.)
At the price of letting the shell do some more work and date(1) do
less, which will slow things down but probably not noticeably, you get
something which is arguably a bit clearer about what's going on:
set file_name to ( do shell script ¬
"echo $(( $(date +%s) - " & date_offset & "))" ) & ".html"
--
Mark J. Reed <[log in to unmask]>