Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert milliseconds to date (in Excel)

Tags:

excel

I have a row in excel with the following data: 1271664970687 (I think it's the number of milliseconds from 1970...). I would like to have addition row that will show it as date/time.

like image 403
Guy Avatar asked Apr 19 '10 08:04

Guy


People also ask

How do you convert milliseconds to dates?

Approach : First declare variable time and store the milliseconds of current date using new date() for current date and getTime() Method for return it in milliseconds since 1 January 1970. Convert time into date object and store it into new variable date. Convert the date object's contents into a string using date.


1 Answers

Converting your value in milliseconds to days is simply (MsValue / 86,400,000)

We can get 1/1/1970 as numeric value by DATE(1970,1,1)

= (MsValueCellReference / 86400000) + DATE(1970,1,1) 

Using your value of 1271664970687 and formatting it as dd/mm/yyyy hh:mm:ss gives me a date and time of 19/04/2010 08:16:11

like image 180
Neil Moss Avatar answered Sep 17 '22 15:09

Neil Moss