I can't for the life of me figure out how to convert a timestamp on the form 1433140740000+0200
to a datetime
object or to any humanly readable representation. Also, what format is this specifically? I'm assuming the +0200
represents a timezone.
I can only seem to find questions regarding timestamps without timezones, such as this answer, where int("1433140740000+0200")
would give me an error. Any help is appreciated. Thanks!
Edit: As mentioned in a comment, further examination of the API from which I am getting these values reveals other timestamps with different values for what I thought to represent timezones. E.g: 315529200000+0100
. The entire line of data looks like this: "ArrivalTime": "/Date(1433051640000+0200)/"
, and the full response can be found here.
Second edit: As far as I can tell, the timestamps are unix timestamps, but they're given in milliseconds (hence the trailing zeros), and the +0200
indicates timezone UTC+02:00. So for now, I'll just trim out the extra zeros and the timezone, and convert as shown in the linked question, before adding the timezone manually afterwards. The timestamps with +0100 remain a mystery to me, but I've found they're always the same date, 1/1/1980 12:00am. They also have a different identifier: ActualTime
, as opposed to ArrivalTime
on the others. Anyway, thanks for the help guys!