python datetime fromtimestamp yielding valueerror year out of range -
this question has answer here:
when attempting convert float formatted timestamp e.g 1437506779950.0
datetime object, i'm getting valueerror "year out of range".
this code used, working not 3 months ago. revisiting now, strangely throwing error yet nothing in code base has changed, data being passed it, , data has changed there timestamp.
>>> f = 1437506779950.0 >>> datetime.datetime.fromtimestamp(float(f)) traceback (most recent call last): file "<stdin>", line 1, in <module> valueerror: year out of range
i can't understand have changed make break?
as noted in answer this question, looks unit conversion issue. have divide timestamp 1000 convert milliseconds seconds.
Comments
Post a Comment