6

Here's a forecast for London, GB from the Open Weather Map in JSON format.

http://api.openweathermap.org/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.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Benjamin
  • 683
  • 1
  • 8
  • 22
  • *"How to translate the dt into a human-friendly format"* http://momentjs.com/ – Felix Kling May 10 '14 at 03:38
  • possible duplicate of [Convert a Unix timestamp to time in Javascript](http://stackoverflow.com/questions/847185/convert-a-unix-timestamp-to-time-in-javascript) – Ayman Safadi May 10 '14 at 03:38

1 Answers1

14

If 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.

Community
  • 1
  • 1
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356