Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert from 12 hrs to 24 python

    >>> from datetime import datetime
    >>> m2 = '1:35 PM'
    >>> in_time = datetime.strptime(m2, "%I:%M %p")
    >>> out_time = datetime.strftime(in_time, "%H:%M")
    >>> print(out_time)
    13:35
Comment

PREVIOUS NEXT
Code Example
Python :: does np.random.randint have a seed 
Python :: invert a dictionary python 
Python :: df concat 
Python :: dropping nan in pandas dataframe 
Python :: format string to 2 decimal places python 
Python :: wikipedia python 
Python :: star pattern in python 
Python :: if django 
Python :: how to use variables in string in python 
Python :: webbrowser.google.open python 
Python :: pil image to numpy 
Python :: python run system command 
Python :: python extract text from image 
Python :: replace a string in a list 
Python :: how to take unknown number of inputs in python 
Python :: numpy generate random 2d array 
Python :: renaming multiple columns in pandas 
Python :: python os remove extension 
Python :: phone number regex python 
Python :: scapy python import 
Python :: time now random seed python 
Python :: how to convert string date to timestamp in python 
Python :: find the closest smaller value in an array python 
Python :: how to write a file in python 
Python :: show multiple matplotlib images 
Python :: swap list items in python 
Python :: python sqlite insert 
Python :: generate a random number in python between 0 and 1 
Python :: bytes to kb mb gb python 
Python :: pandas read column in date format 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =