1

How can we count the number of seconds passed since the start of the day 0.00 ? Is there a module function or do we have to do it ourselves?

0

1 Answer 1

9
from datetime import datetime, time now = datetime.now() beginning_of_day = datetime.combine(now.date(), time(0)) print (now - beginning_of_day).seconds 

See docs for datetime module here.

Sign up to request clarification or add additional context in comments.

3 Comments

That solves the windows problem, but how to do it in pys60. There is no datetime module in it.
If you were interested in solution for pys60 you'd better specify that in the first place. Looks like you can add datetime module manually. Have a look at this snippet.
I initially tagged it pys60 but everytime I submitted my question an error (quality standards) kept coming ani I edited the title and tagged it python and it somehow worked. But, thanks It'll help me a lot

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.