August 2018
Intermediate to advanced
366 pages
10h 14m
English
Most recent Python versions introduced a method to quickly convert datetimes back and forth from timestamps:
>>> import datetime >>> ts = 1521588268 >>> d = datetime.datetime.utcfromtimestamp(ts) >>> print(repr(d)) datetime.datetime(2018, 3, 20, 23, 24, 28) >>> newts = d.timestamp() >>> print(newts) 1521584668.0