python date to seconds code example
Example 1: python datetime milliseconds
from datetime import datetime
print(datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S.%f')[:-3])
Example 2: python datetime to seconds
from datetime import datetime
dt = datetime.today() # Get timezone naive now
seconds = dt.timestamp()