Contact: aviboots(AT)netvision.net.il
39,938 questions
51,875 answers
573 users
from datetime import datetime dt = datetime.strptime("21/04/2021 12:54:34", "%d/%m/%Y %H:%M:%S") print("{:d}:{:02d}".format(dt.hour, dt.minute)) ''' run: 12:54 '''
from datetime import datetime dt = datetime.strptime("21/04/2021 12:54:34", "%d/%m/%Y %H:%M:%S") print(dt.hour, ":", dt.minute) ''' run: 12 : 54 '''