http://www.newton-inc.com/dev/techinfo/qa/qa.htm
'gmt
slot of a city entry, which can be gotten with the GetCityEntry
global function. See the "Built In Apps and System Data" chapter of the Newton Programmers Guide for details. Note that the docs incorrectly say the gmt
slot contains the offset in minutes, when it is actually specified in seconds. The current location is available in the 'location
slot of the user configuration frame. Use GetUserConfig('location)
to access it. The global function LocalTime
can be used to convert a time to the local time in a distant city.LocalTime
to compute the delta between the current city and the GMT city, then add the delta to the given GMT time. LocalTime
can be used directly to go the other way--getting the GMT time from the local time.LocalTime
(time
, where
)time
- a time in minutes in the local (Newton device) zone, for example as returned from the Time
functionwhere
- a city entry, as returned from GetCityEntry
result
- a time in minutes in the where city, adjusted as necessary for time zone and daylight savings.LocalTime
tells you the local time for the distant city, given a time in the current city. For example, to find out the time in Tokyo: Date(LocalTime(time(), GetCityEntry("Tokyo")[0])) #C427171 {year: 1997, month: 2, Date: 22, dayOfWeek: 6, hour: 8, minute: 1, second: 0, daysInMonth: 28}
DSTOffset
can be used to find out how much these daylight savings time rules have adjusted a given time for a given city. DSTOffset(time, where)
time
- a time in minutes in the where city where
- a city entry, as returned from GetCityEntry
result
- an integer, number of minutes that daylight savings adjusted that time in that city.DSTOffset
tells you what the daylight savings component is of a given time in a given location. This component would need to be subtracted from the result of the global function Time
to get a non-daylight-adjusted time for the current location. // it's currently 2:52 PM on 3/4/97, no DST adjustment DSTOffset(Time(), GetCityEntry("Cupertino")[0]); #0 0 // but during the summer, DST causes the clocks to "spring forward" an hour. DSTOffset(StringToDate("6/6/97 12:34"), GetCityEntry("Cupertino")[0]); #F0 60