Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Show-the-epoch/AppleScript/show-the-epoch-1.applescript
Normal file
15
Task/Show-the-epoch/AppleScript/show-the-epoch-1.applescript
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use AppleScript version "2.4" -- OS X 10.10 (Yosemite) or later
|
||||
use framework "Foundation"
|
||||
use scripting additions
|
||||
|
||||
local CocoaEpoch, UnixEpoch
|
||||
|
||||
-- Get the date 0 seconds from the Cocoa epoch.
|
||||
set CocoaEpoch to current application's class "NSDate"'s dateWithTimeIntervalSinceReferenceDate:(0)
|
||||
-- The way it's rendered in its 'description' is good enough for the current purpose.
|
||||
set CocoaEpoch to CocoaEpoch's |description|() as text
|
||||
|
||||
-- Get the date 0 seconds from the Unix epoch and format it in the same way.
|
||||
set UnixEpoch to (do shell script "date -ur 0 '+%F %T %z'")
|
||||
|
||||
return "Cocoa epoch: " & CocoaEpoch & linefeed & "Unix epoch: " & UnixEpoch
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
"Cocoa epoch: 2001-01-01 00:00:00 +0000
|
||||
Unix epoch: 1970-01-01 00:00:00 +0000"
|
||||
Loading…
Add table
Add a link
Reference in a new issue