How to convert a seconds series since 2012-01-01 0:0:0
to a time format expression.
And the inverse?
Convert a time expression, such as 2015-6-23 10:00:00
, to the seconds since 2012-01-01 0:0:0
.
How to convert a seconds series since 2012-01-01 0:0:0
to a time format expression.
And the inverse?
Convert a time expression, such as 2015-6-23 10:00:00
, to the seconds since 2012-01-01 0:0:0
.
import datetime as dt
print (dt.datetime(2015,1,2) - dt.datetime(2015,1,1)).total_seconds()
print dt.datetime(2015,1,1) + dt.timedelta(seconds=3600*24)
http://testedanswers.com/questions/-JsT943k5Y8lTp2dOb3s