S
S
Stani102015-07-04 18:47:51
JavaScript
Stani10, 2015-07-04 18:47:51

How to parse OpenWeatherMap date?

Working with the openweathermap api, I encountered such a problem: they store the date in this format: "1436022000". What is this format and how to parse it into javascript date?
new Date(1436022000) returns the following: Thu Jan 01 1970 05:00:00

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zuev, 2015-07-04
@Stani10

Unix time
Number of seconds elapsed since January 1, 1970
Hence the output
var date = new Date(1436022000 * 1000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question