def reverse_date_strings_with_time(date_str):
    """
    Function to use as a parameter for reverse_date_strings(format_func=reverse_date_strings_with_time)
    Reverses date and keeps HH:MM at the end if it exists on original string.

    :return: String formatted
    """
    date_parts = date_str.replace('T', ' ')[:16].split(' ')
    date_parts[1] = ' %s' % date_parts[1] if len(date_parts) > 1 else ''
    return '%s%s' % ('-'.join(reversed(date_parts[0].split('-'))),
        date_parts[1])
