(time_str)
return (parse_result[0] - datetime.min).total_seconds()
Convert a given time interval (e.g. '5m') into the number of seconds in that interval

    :param time_str: the string to parse
    :returns: the number of seconds in the interval
    :raises ValueError: if the string could not be parsed
Convert a given time interval (e.g. '5m') into the number of seconds in that interval
Convert a given time interval ( e . g . 5m ) into the number of seconds in that interval
def parse_time_interval_seconds(time_str):
    """ Convert a given time interval (e.g. '5m') into the number of seconds in that interval

    :param time_str: the string to parse
    :returns: the number of seconds in the interval
    :raises ValueError: if the string could not be parsed
    """
    cal = parsedatetime.Calendar()
    parse_result = cal.parseDT(time_str, sourceTime=datetime.min)
    if parse_result[1] == 0:
        raise ValueError("Could not understand time {time}".format(time=time_str))
    return (parse_result[0] - datetime.min).total_seconds()
def parse_time_interval_seconds ( time_str ) : cal = parsedatetime . Calendar ( ) parse_result = cal . parseDT ( time_str , sourceTime = datetime . min ) if parse_result [ 1 ] == 0 : raise ValueError ( "Could not understand time {time}" . format ( time = time_str ) ) return ( parse_result [ 0 ] - datetime . min ) . total_seconds ( )