I have a python script wich runs as a continous service for long time (days, month ...). From time to time data from the serial port comes in. These values were calculated and stored in a database. Everything is ok so far.
Now I want to extend the script a bit. Therefore I am looking for a built in method from eg. datetime .., which returns the past seconds of each day as an Integer value when the data comes in. There is no need for timezone, epoche ...
For a other reason I just use someting like this "t = time.strftime('%H:%M') ". This works.
But, can I get the seconds as Int in one step ? Must I calculate it by myself ? Or have I overseen something in the docs ?