(date_str)
Returns base for the time string `date_str` passed.

    :param date_str: str
    :return: str
Returns base for the time string `date_str` passed.
Returns base for the time string date_str passed .
def time_base(date_str):
    """Returns base for the time string `date_str` passed.

    :param date_str: str
    :return: str
    """
    old_link_date = datetime.datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S')
    time_delta = datetime.datetime.utcnow() - old_link_date
    delta_seconds = time_delta.total_seconds()
    if (delta_seconds / (60*60)) < 1:
        return 'minute'
    elif (delta_seconds / (60*60*24)) < 1:
        return 'hour'
    elif (delta_seconds / (60*60*24*30)) < 1:
        return 'day'
    else:
        return 'month'
def time_base ( date_str ) : old_link_date = datetime . datetime . strptime ( date_str , '%Y-%m-%d %H:%M:%S' ) time_delta = datetime . datetime . utcnow ( ) - old_link_date delta_seconds = time_delta . total_seconds ( ) if ( delta_seconds / ( 60 * 60 ) ) < 1 : return 'minute' elif ( delta_seconds / ( 60 * 60 * 24 ) ) < 1 : return 'hour' elif ( delta_seconds / ( 60 * 60 * 24 * 30 ) ) < 1 : return 'day' else : return 'month'