Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert 12 hour into 24 hour time

>>> from datetime import datetime

    >>> m2 = '1:35 PM'
    >>> in_time = datetime.strptime(m2, "%I:%M %p") #Converts string to 12 hour time format
    >>> out_time = datetime.strftime(in_time, "%H:%M") #Converts 12 hour to 24 hour time format
    >>> print(out_time)
    13:35
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #hour #hour #time
ADD COMMENT
Topic
Name
2+6 =