Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to display local times in Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to display local times in Address Book
Authored by: miles_thatsme on Mar 14, '05 01:55:18PM
You really do need a lookup to make this useful, I think. A good place to start might be http://www.timeanddate.com. It seems like you can append the name of any city to the following to get the current time zone:

http://www.timeanddate.com/worldclock/results.html?query=

You then just need to extract the text so that it appears in address book's menu...

[ Reply to This | # ]
A script to display local times in Address Book
Authored by: edchrist on Mar 15, '05 08:32:17AM
you can get the timezone based on Longitude of an address and csgnetwork does lookup of zipcode that returns the Longitude which I used to create this timezone look up function:


on gettz(addrzip)
	set cmdscrpt to "echo `curl http://www.csgnetwork.com/cgi-bin/zipcodes.cgi -s -d Zipcode=" & addrzip & " -G|grep Longitude|cut -f 6 -d '>'|cut -f 1 -d '<'`"
	do shell script cmdscrpt
	set lat to the result as real
	if lat > 0 then
		set tznew to (lat + 7.5) / 15 as integer
	else
		set tznew to (lat - 7.5) / 15 as integer
	end if
	return tznew
end gettz


[ Reply to This | # ]