Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/System-time/AppleScript/system-time-1.applescript
Normal file
1
Task/System-time/AppleScript/system-time-1.applescript
Normal file
|
|
@ -0,0 +1 @@
|
|||
display dialog ((current date) as text)
|
||||
14
Task/System-time/AppleScript/system-time-2.applescript
Normal file
14
Task/System-time/AppleScript/system-time-2.applescript
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
set now to (current date)
|
||||
set GMTOffset to (time to GMT)
|
||||
copy now to epoch
|
||||
tell epoch to set {its day, its month, its year, its time} to {1, January, 2001, 0}
|
||||
set systemTime to now - GMTOffset - epoch
|
||||
|
||||
-- Format output:
|
||||
set offsetStr to GMTOffset div hours * 100 + GMTOffset mod hours div minutes
|
||||
if (GMTOffset < 0) then
|
||||
set offsetStr to " -" & text 3 thru -1 of ((-10000 + offsetStr) as text)
|
||||
else
|
||||
set offsetStr to " +" & text 2 thru -1 of ((10000 + offsetStr) as text)
|
||||
end if
|
||||
return (now as text) & offsetStr & (linefeed & systemTime) & (" seconds since " & epoch & " UTC")
|
||||
2
Task/System-time/AppleScript/system-time-3.applescript
Normal file
2
Task/System-time/AppleScript/system-time-3.applescript
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"Tuesday 30 June 2020 at 11:34:31 +0100
|
||||
6.15206071E+8 seconds since Monday 1 January 2001 at 00:00:00 UTC"
|
||||
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)
|
||||
2
Task/System-time/AppleScript/system-time-5.applescript
Normal file
2
Task/System-time/AppleScript/system-time-5.applescript
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"Tuesday 30 June 2020 at 11:34:34 British Summer Time
|
||||
6.152060746444E+8 seconds since 2001-01-01 00:00:00 +0000"
|
||||
Loading…
Add table
Add a link
Reference in a new issue