Atlas
Atlas copied to clipboard
feature request: determine timezone offset for local timestamp
I'd like a feature where I submit a date and local time (without a timezone) and get, if possible, the timezone for this time and/or a fully tz-aware timestamp.
This is a bit ugly since it has edge cases: timestamps can either not be valid or ambigious, e.g. when they fall in a DST switch. For me, erroring out would be acceptable behavior in both cases.
I'm not sure I understand. If you have a date like 2017-06-24 and a time like 10:00 then it could be in any timezone. What is the piece of information you want to use to determine which timezone it's in?
Sorry – in combination with a location of course. Right now I can get from a location query like /api/geocode?input=Portland,+OR or http://atlas.p3k.io/api/timezone?latitude=45.5118&longitude=-122.6433 the local time and timezone offset right now, but not the timezone offset for a local time in the future (which might be different due to DST).
Gotcha, yes that'd be great. I think this would make the most sense as another parameter to the /timezone API call, e.g.
http://atlas.p3k.io/api/timezone?latitude=45.5118&longitude=-122.6433&localtime=2017-06-24T10:00:00
which also suggests the /timezone API should accept a text input that is first run through the geocoder. technically that's basically the /geocode API but being able to request a local time would make sense to happen here