datetime.fromtimestamp vs datetime.utcfromtimestamp, which one is safer to use?
问题 I'm collecting some data from sensors and I get the timestamp from it like this: "time": { "seconds": 40, "year": 115, "month": 5, "hours": 7, "time": 1434549820776, "date": 17, "minutes": 3, "day": 3, "timezoneOffset": 420 }, I have a python script that processes the data coming from the sensors (incoming data is json format), I take the value of time and converts into readable time format. I used datetime.fromtimestamp(1434549820776/1000).strftime('%Y-%m-%d %H:%M:%S') and that returned