Here's a forecast for London, GB from the Open Weather Map in JSON format.
.5/forecast/daily?id=524901
Each list item in the JSON has a key within it called dt
that looks like "dt":1399626000
I haven't done this before, so how do I figure out what format (unix timestamp?) and timezone dt
is in (e.g. GMT, UTC), and how to translate the dt
into a human-friendly format.
Here's a forecast for London, GB from the Open Weather Map in JSON format.
http://api.openweathermap/data/2.5/forecast/daily?id=524901
Each list item in the JSON has a key within it called dt
that looks like "dt":1399626000
I haven't done this before, so how do I figure out what format (unix timestamp?) and timezone dt
is in (e.g. GMT, UTC), and how to translate the dt
into a human-friendly format.
- "How to translate the dt into a human-friendly format" momentjs. – Felix Kling Commented May 10, 2014 at 3:38
- possible duplicate of Convert a Unix timestamp to time in Javascript – Ayman Safadi Commented May 10, 2014 at 3:38
1 Answer
Reset to default 14If I'm on the right page, the API documentation says here that it's a GMT Unix timestamp:
dt | Time of data receiving in unixtime GMT
To convert it into a human-readable format using JavaScript, see the answer to this question.