Answers for "convertir datetime to timestamp django"

0

convertir datetime to timestamp django

>>> datetime.datetime(2012,4,1,0,0).timestamp()
1333234800.0
Posted by: Guest on May-26-2020
0

convertir datetime to timestamp django

# Format it into seconds
>>> datetime.datetime(2012,04,01,0,0).strftime('%s')
'1333234800'

# OR, subtract the time with 1 Jan, 1970 i.e start of epoch time
# get the difference of seconds using `total_seconds()`
>>> (datetime.datetime(2012,04,01,0,0) - datetime.datetime(1970,1,1)).total_seconds()
1333238400.0
Posted by: Guest on May-26-2020

Code answers related to "convertir datetime to timestamp django"

Python Answers by Framework

Browse Popular Code Answers by Language