What timezone does the Aeris Weather API respond in?

The API will respond in both local time, as well as Epoch time depending on which field you are looking at.

Here's an example from our observations endpoint for sunrise and sunset data in Minneapolis, MN:


       "success": true,
       "error": null,
       "response": {
              "ob": {
                     "sunrise": 1485783187,
                     "sunriseISO": "2017-01-30T07:33:07-06:00",
                     "sunset": 1485818379,
                     "sunsetISO": "2017-01-30T17:19:39-06:00"

The sunrise​ & sunset values display the sunrise & sunset times in Epoch. The sunriseISO​ & sunsetISO​ values are the local times for these values. If your goal is to hit the local time directly, I would recommend using the sunriseISO​ & sunsetISO​ values. If your application requires a response with UTC time, I would recommend using the sunrise​ & sunset values and convert to UTC format.

The sunriseISO​ & sunsetISO​​ values contain a time offset next to their value (example: Minneapolis is 2017-01-30T07:33:07-06:00). This indicates the offset from UTC. So Minneapolis is minus 6:00 hours from UTC.

Additionally, most endpoints will provide a profile.tz value which indicates the queried locations timezone. Then you can use your programming languages date functionality to output custom date/times that are localized.

For example in php, assuming $json is the API response object:

echo date('H:i:s', $json->sunrise);

The above will set PHP to use the localized timezone, then allowing you to use any of the date/time formats found here.

If you're using javascript and/or nodeJS, you can use the Moment and Moment Timezone libraries.

These are the methods we use for obtaining localized date/times with many of our projects.