Do you recognize a 16-digit timestamp?

Im working with google bookmakrs and returning a 16 digit timestamp that I can't seem to recognize in C # to turn into real dates, any ideas?

how to enable this timestamp: 1278276905502403 for something that makes sense in c #?

+5
source share
2 answers

It looks like UNIX time in microseconds. That is, the number of microseconds since 1970.01.01 00:00:00.

You can try something like:

dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
dateTime = dateTime.AddMilliseconds(value/1000);

(This is probably the best way to do this, but I don't know C #.)

Instead of Python:

>>> time.ctime(1278276905502403/1000000)
'Sun Jul  4 22:55:05 2010'
+8
source

A timestamp is the number of microseconds since an era (01/01/1970 00:00:00 UTC).

DateTime # :

var timestamp = 1278276905502403;
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
var myDate = epoch.AddMilliseconds(timestamp / 1000);

timestamp: 07/04/2010 08:55:05 PM

+4

All Articles