rough estimate of the time offset from GMT from latitude longitude

前端 未结 3 2032
故里飘歌
故里飘歌 2021-02-19 19:25

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

3条回答
  •  长发绾君心
    2021-02-19 20:05

    If you know the users longitude, you completely know every aspect of time for them (neglecting some small errors like special relativity etc). The mean solar time is simply the difference of GMT and longitude (convert degrees part to minutes, 1 degree = 60 minutes). You add or subtract based on East or West. Mean solar time is basically more accurate time then time zones. Day time and night time times are variable and depend on latitude, so you use some approximations of sunrise and sunset times taking in latitude and the date and year. This alone would provide fairly accurate notion of daytime and night.

提交回复
热议问题