Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/System-time/AppleScript/system-time-4.applescript
Normal file
16
Task/System-time/AppleScript/system-time-4.applescript
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use AppleScript version "2.4" -- Mac OS 10.10 (Yosemite) or later.
|
||||
use framework "Foundation"
|
||||
|
||||
set now to current application's class "NSDate"'s |date|()
|
||||
set systemTime to now's timeIntervalSinceReferenceDate()
|
||||
-- Or, since timeIntervalSinceReferenceDate() is both an instance method and a class method:
|
||||
-- set systemTime to current application's class "NSDate"'s timeIntervalSinceReferenceDate()
|
||||
|
||||
-- Format output:
|
||||
set currentLocale to current application's class "NSLocale"'s currentLocale()
|
||||
set nowAsText to (now's descriptionWithLocale:(currentLocale)) as text
|
||||
set epoch to now's dateByAddingTimeInterval:(-systemTime)
|
||||
-- Or:
|
||||
-- set epoch to current application's class "NSDate"'s dateWithTimeIntervalSinceReferenceDate:(0)
|
||||
set epochAsText to epoch's |description|() as text
|
||||
return nowAsText & (linefeed & systemTime) & (" seconds since " & epochAsText)
|
||||
Loading…
Add table
Add a link
Reference in a new issue