Scripting Additions Guide

CHAPTER 2
Scripting Addition Commands
Command Definitions 67
time to GMT
--result: -28800
You can then use this value to write a script that tells you the time difference
between the time in any other time zone and the current time in Cupertino:
property offsetFromCupertino : -28800
set x to ((time to GMT) ÷ 60) ÷ 60
set y to x - (((offsetFromCupertino) ÷ 60) ÷ 60)
if y = 0 then
display dialog ("Same time zone as Cupertino") as string
else
if y > 0 then
display dialog (y & " Hours Ahead of Cupertino") as
string
else
display dialog (-y & " Hours Behind Cupertino") as
string
end if
end if
To see the effect this script has for different time zones, try setting the time
from the Map control panel to various locations, for example, Tokyo, London,
and Atlanta.
ERRORS
Error
number Error message
–108 Out of memory.
–1700 Can't make some data into the expected type.
–1701 Some parameter is missing for <commandName>.
–1704 Some parameter was invalid.