rough estimate of the time offset from GMT from latitude longitude
问题 Is there a way to estimate the offset from GMT (or time zone) from a latitude/longitude? I've seen geonames, but this would need to work long term and we don't really want to rely on a web service. It'd just be used for determining whether to display "today" or "tonight" when giving information to various users so it wouldn't need to be too accurate (an hour or two off wouldn't be bad). 回答1: offset = direction * longitude * 24 / 360 where direction is 1 for east, -1 for west, and longitude is