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?
1 Answer
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.
3 Comments
Dinesh Khadka
That solves the windows problem, but how to do it in pys60. There is no datetime module in it.
KL-7
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.Dinesh Khadka
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