How to get a time zone from a location using latitude and longitude coordinates?

后端 未结 17 1546
走了就别回头了
走了就别回头了 2020-11-21 04:38

Given the latitude and longitude of a location, how does one know what time zone is in effect in that location?

In most cases, we are looking for an IANA/Olson time z

17条回答
  •  死守一世寂寞
    2020-11-21 05:06

    disclosure: I am the author of the docker-image described below

    I have wrapped https://github.com/evansiroky/node-geo-tz in a very simple docker-container

    https://hub.docker.com/repository/docker/tobias74/timezone-lookup

    You can start the docker-container with

    docker run -p 80:3000 tobias74/timezone-lookup:latest
    

    This exposes the lookup-service on your localhost on port 3000. You can then do a timezone-lookup by

    curl "localhost:3000/timezone?latitude=12&longitude=34"
    

提交回复
热议问题