I want to add my flight event to Outlook using ICal.cs.
For example, I have a flight on July 10, 7:30 in the morning from Toronto, YYZ Airport.
I want to use the Google timezone API to return the original offset and DST shift, so I can calculate the local flight time in UTC and use ICal in my file.
The Google API below requires passing a timestamp. Interestingly, do they require a UTC timestamp or not?
This is their description of this value:
timestamp indicates the desired time in seconds since midnight, January 1, 1970 UTC. The timezone API uses a timestamp to determine whether summer savings should be applied. Times before 1970 can be expressed as negative values.
I can get the latitude and longitude for YYZ airport, but how can I calculate this timestamp for my flight time if I don't know the time offsets in advance?
https://maps.googleapis.com/maps/api/timezone/json?location=43.700113788,-79.416304194×tamp=1419283200&sensor=false
This is what it returns:
{"dstOffset": 0.0, "rawOffset": -18000.0, "status": "OK", "timeZoneId": "America / Toronto", "timeZoneName": "Eastern Standard Time"}
source share