Python Datetime Temps en secondes
import datetime
datetime.datetime.now().timestamp()
Gianluca Ghigo
import datetime
datetime.datetime.now().timestamp()
import datetime
current_time = datetime.datetime.now()
seconds = current_time.second
minutes = current_time.minute
from datetime import datetime
dt = datetime.today() # Get timezone naive now
seconds = dt.timestamp()
>>> from datetime import datetime
>>> datetime.fromtimestamp(1485714600).strftime("%A, %B %d, %Y %I:%M:%S")
'Sunday, January 29, 2017 08:30:00'