I have a field that shows time as 1900-01-01 00:05:00
but I want to show it as just 00:05:00
i.e. just five minutes.
I have been looking at the python documentation and it is driving me crazy. From the question How do I find the time difference between two datetime objects in python? it looks like is should be something do with timedelta
but I am not getting any closer to a solution. The question Converting Date/Time to Just Time suggests you can just use a format
tag but that is not working for me. I also looked at converting date time to string without success, I know this is something simple but I have looked at hundreds of pages looking for something simple. All help would be appreciated.
Say you have a Datetime
object now
:
now.time().strftime('%H:%M:%S')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With