# Extract time from datetime in Python # import important moduleimport datetimefrom datetime import datetime  # Create datetime stringdatetime_str = "24AUG2001101010"  # call datetime.strptime to convert# it into datetime datatypedatetime_obj = datetime.strptime(datetime_str,                                  "%d%b%Y%H%M%S")  # It will print the datetime objectprint(datetime_obj)  # extract the time from datetime_objtime = datetime_obj.time()    # it will print time that # we have extracted from datetime objprint(time) 