I have bunch of timestamps from consolidated.db on iphone 5 (ex 402102940.4584 ; 402259796.647231 ; 402373726.55571 and so on). I need using python get some meaning out of them. Is there any way I can translate them?
Asked
Active
Viewed 2,681 times
-3
-
The big number recorded in the time stamp is the amount of time, in seconds, since January 1, 2001. So I got unix time-stamp for January 1, 2001 unixTS = 978307200 (GMT)(which is also in seconds). So that now date = str(datetime.datetime.fromtimestamp(unixTS + iphoneTS)) works. – user3029893 Nov 30 '13 at 21:57
2 Answers
2
I tried that, but 1982 timestamp for iphone 5 is not right. It is not unix format timestamp it is as I understand NSdate format which I dont know what I can do.
What found later: The big number recorded in the time stamp is the amount of time, in seconds, since January 1, 2001. So I got unix time-stamp for January 1, 2001 (GMT) (which is also in seconds). So that now:
>>>unixTS = 978307200
>>>date = str(datetime.datetime.fromtimestamp(unixTS + iphoneTS))

user3029893
- 51
- 1
- 4
-
Great answer, this an actual problem, question should not be closed in first place! – Evalds Urtans Mar 03 '23 at 10:55
0
You can try like this.
>>> d = datetime.datetime.fromtimestamp(402373726.55571)
datetime.datetime(1982, 10, 2, 10, 28, 46, 555710)
>>> str(d)
'1982-10-02 02:28:46.555710'
-
I tried that, but 1982 timestamp for iphone 5 is not right. It is not unix format timestamp it is as I understand NSdate format which I dont know what I can do. – user3029893 Nov 26 '13 at 21:52