The current time in seconds since the UNIX epoch is easy to obtain in AppleScript. Calculate the difference since the UNIX epoch of January 1, 1970 and adjust for the local GMT offset. The 1970 date format will have to be adjusted for the local machines format.
(current date) - (date ("1/1/1970")) - (time to GMT)
Here is a kludge to convert the real result to an integer string
set nowSeconds to ((current date) - (date ("1/1/1970")) - (time to GMT)) as miles as string
The miles class can be most anything like gallons, feet, etc
No comments:
Post a Comment