from datetime import datetime, time
utcnow = datetime.utcnow()
midnight_utc = datetime.combine(utcnow.date(), time(0))
delta = utcnow - midnight_utc
print(delta.seconds)
Number of seconds since the beginning of the day UTC timezone