Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to measure time elapsed from full hour?

I’m looking for a way to count time difference between current time and last full hour. (e.g it’s 11:31 now so it’s 00:31 from 11:00) time.strftime('%H:00:00') returns string 11:00:00 but Im totally clueless what to do next.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

time.strftime('%M:00')

You want to get the minutes and don’t care about the hours. So just format the minutes as output. Or perhaps you want to get the minutes from a datetime object as number:

m = datetime.now().minute
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading