It’s pretty easy to get a datetime object from a timestamp in Python. However the same can not be said the other way around. Just when I start to think “oh Python’s pretty cool with a nice API” the further you look into the language and library you start to notice some cracks.
Convert a timestamp to a datetime object
1 2 3 4 5 |
|
Convert a datetime object to a timestamp
Why oh why did they not just implement a datetime.totimestamp()
method on datetime?
1 2 3 4 5 6 7 8 |
|