I scratch my head several times over the Google timezone API for several minutes, particularly in the timestamp parameter. This may require:
In San Diego, we (now, in August) have a GMT offset of -8 due to daylight saving time. However, in November we will have a GMT -7 offset .
So which gmt offset should Google return? -7 or -8? They are both valid, but it depends on which day you take the measurement.
Enter a timestamp argument. By starting the service now and using the timestamp value of August 2015 , I get this answer:
{ "dstOffset" : 3600, "rawOffset" : -28800, "status" : "OK", "timeZoneId" : "America/Los_Angeles", "timeZoneName" : "Pacific Daylight Time" }
But if I remove the mark before November 2015 (as soon as San Diego reaches its daily savings, I end up with this):
{ "dstOffset" : 0, "rawOffset" : -28800, "status" : "OK", "timeZoneId" : "America/Los_Angeles", "timeZoneName" : "Pacific Standard Time" }
In both cases, rawOffset is the same, but the DST has changed due to the timestamp I provided. If you just want to know the raw time zone, the timestamp doesn't matter.
But if you want the app to do something reliably at 8:00 in San Diego in August and at 8:00 in November in San Diego, you will need to use a timestamp.
In other words, what is the value of knowing that San Diego is usually 7 hours from GMT. If you work with time zones, you are probably trying to ensure that UTC time matches what a real person experiences in this place. Thus, the DST offset is critical.