utils/Utils.py
def guessTimeFormat(val:object) -> str:
    """Helper method to determine the time strf string.
    
    :param val: Time string to try to parse.
    :return: Format string.
    """
    if type(val) is not str:
        val=str(val)

    formats = ['%H:%M:%S.%f', '%M:%S.%f', '%M:%S', '%S.%f', '%S']
    for fmt in formats:
        try:
            datetime.strptime(val, fmt)
        except ValueError:
            try:
                pandas.to_datetime(val, unit='s')
            except ValueError:
                continue
            break
        break
    #print('Time format of ' + val + ' string is guessed as ' + fmt + '.')
    return fmt
Helper method to determine the time strf string.
    
    :param val: Time string to try to parse.
    :return: Format string.
    
Helper method to determine the time strf string.
Helper method to determine the time strf string .
def guessTimeFormat(val:object) -> str:
    if type(val) is not str:
        val=str(val)
    formats = ['%H:%M:%S.%f', '%M:%S.%f', '%M:%S', '%S.%f', '%S']
    for fmt in formats:
        try:
            datetime.strptime(val, fmt)
        except ValueError:
            try:
                pandas.to_datetime(val, unit='s')
            except ValueError:
                continue
            break
        break
    return fmt
def guessTimeFormat ( val : object ) -> str : if type ( val ) is not str : val = str ( val ) formats = [ '%H:%M:%S.%f' , '%M:%S.%f' , '%M:%S' , '%S.%f' , '%S' ] for fmt in formats : try : datetime . strptime ( val , fmt ) except ValueError : try : pandas . to_datetime ( val , unit = 's' ) except ValueError : continue break break return fmt
Helper method to determine the time strf string.
Helper method to determine the time strf string .
"""Helper method to determine the time strf string.
    
    :param val: Time string to try to parse.
    :return: Format string.
    """ #print('Time format of ' + val + ' string is guessed as ' + fmt + '.')
None
val
object
Time string to try to parse.
Time string to try to parse .