Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A "time zone" is NOT an offset! It bothers me that so many APIs make this common mistake. Don't be fooled by the fact that the return field is called "timeZone".</p> <p>A "time zone" is an region that can have one or more offsets throughout the year. You can resolve an offset from a time zone and a date, but you cannot go the other direction! <a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones" rel="nofollow noreferrer">A list of TZDB time zones is here</a>.</p> <p>The specific time zone would be <code>America/Vancouver</code> - not because your lat/lon matched the city of Vancouver, but because Vancouver happens to be the reference city for the time zone of your location. Not every city has its own time zone id, so you can't make any assumptions.</p> <p>-07:00 is the <em>current</em> offset for the <code>America/Vancouver</code> time zone. It happens to be the daylight savings offset. When daylight savings ends, it will change to <code>-08:00</code>. It would appear that the particular web service you are using does not reveal this information.</p> <p>There are several other questions on StackOverflow that already answer how to resolve an actual time zone from a lat/lon. There are web services you can call, or you can use your own database. Here are some links:</p> <ul> <li><a href="https://stackoverflow.com/q/41504/634824">Timezone lookup from latitude longitude</a></li> <li><a href="https://stackoverflow.com/q/3867450/634824">mapping location to a time zone</a></li> <li><a href="https://stackoverflow.com/q/15867990/634824">Ruby - Sort MongoDB records by Timezone?</a></li> <li><a href="https://stackoverflow.com/q/2357030/634824">Timezone lookup</a></li> <li><a href="https://stackoverflow.com/q/4989404/634824">lon,lat to timezone</a></li> </ul> <p>I'm sure there are more. I was tempted to close this as a duplicate, but I hadn't seen ipinfodb.com referenced before.</p> <p>If you are certain that your API returns the <em>current</em> offset, and you just want the user's <em>current</em> time, then as Jonathon pointed out in the question comments, you can just apply the offset to the current UTC time and you'll know what the time is in that location. But you'll have to do this every time. You can't save that offset and use it again later. For that, you need the full time zone reference.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload