Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What format is this date value in?

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.

like image 245
Benjamin Avatar asked May 10 '14 03:05

Benjamin


People also ask

What is a default format for a date value?

By default, the date format is MM/DD/YYYY HH24:MI:SS.US. uses the default date format when you perform the following actions: Convert a date to a string by connecting a date/time port to a string port. converts the date to a string in the date format defined in the session configuration object.

What does Datevalue represent in Excel?

The DATEVALUE function is helpful in cases where a worksheet contains dates in a text format that you want to filter, sort, or format as dates, or use in date calculations. To view a date serial number as a date, you must apply a date format to the cell.

How do I convert Datevalue to date?

The DATEVALUE function in Excel converts a date in the text format to a serial number that Excel recognizes as a date. So, the formula to convert a text value to date is as simple as =DATEVALUE(A1) , where A1 is a cell with a date stored as a text string.


1 Answers

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.

like image 80
BoltClock Avatar answered Sep 18 '22 22:09

BoltClock