I want to display time only by "Hours:Minutes".
For example, if it's 9:30 AM, it'll only display 9:30.
If it's 10:20 PM, it'll only display 10:20.
Doesn't matter if "AM" or "PM" won't show.
I googled "how to display time to 12 hours python" and I see this same method below here and other similar threads:
from datetime import datetime
d = datetime.strptime("10:30", "%H:%M")
d.strftime("%I:%M %p")
print(d.strftime("%I:%M %p"))
The problem is... it always shows "10:30 AM".
What if my current time is 9:20 PM? How will that be changed?
What if I want to show my current time hundred times?
I can't change the first argument in "d = datetime.strptime("10:30", "%H:%M")" hundred times. Not a good idea.