MACSCRPT Archives

September 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Tue, 22 Sep 2009 15:40:11 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
On Sep 22, 2009, at 2:52 PM, Brian Johnson wrote:

>  property zdate: date "Monday, August 10, 1992 11:00:00 AM"
>  set file_name to ((current date)-zdate as text) & ".html"

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.

Let me explain the code.

the time_offset is the difference between your epoch date and the unix  
one or 713458800 seconds

-j means don't set the clock
-v means I don't want now I want some other time
the S means I want it offset in seconds and the minus means before  
now.  I am not sure what happens if the epoch cross each other.

the +%s means output in seconds since the epoch.

-Mark
y2k was an epoch fail.

ATOM RSS1 RSS2