1

I have got the following datetime from an API: 1395401384298

I am guessing it is in epoch miliseconds time (it should be one day in 2014) How can i convert it into a more readable String? I have been looking into DateString[] (https://reference.wolfram.com/mathematica/ref/DateString.html) with no success.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
José D.
  • 1,135
  • 10
  • 23

2 Answers2

5

The epoch starts from jan 01 1970, so you can do:

to = AbsoluteTime[{1970, 1, 1, 0, 0, 0.`}];

DateString[1395858190 + to]

Wed 26 Mar 2014 18:23:10

From http://www.epochconverter.com/

GMT: Wed, 26 Mar 2014 18:23:10 GMT

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
user8074
  • 1,592
  • 8
  • 7
0

It is in the very fa future :) DateString[1395401384298] "Tue 5 Jul 46118 23:38:18"

Adding a dot brings closer: DateString[1395401384.298] "Tue 21 Mar 1944 11:29:44"

So check the data you have received. János

  • That is the wrong answer i am getting. The right answer is GMT: Fri, 21 Mar 2014 11:29:44 GMT (you can check it in http://www.epochconverter.com/ ) – José D. Mar 26 '14 at 17:46