def METHOD_NAME(timestampstring):
    """Format the time based on time back in time"""
    timestamp = parse_datetime(timestampstring)
    now = datetime.now()
    date_format = '%d.%b %H:%M:%S'
    if now.year != timestamp.year:
        date_format = '%Y-%m-%d %H:%M:%S'
    elif now.date() == timestamp.date():
        date_format = '%H:%M:%S'
    return timestamp.strftime(date_format)