def format_timestamp(timestamp, weekday=False):
    """Converts a timestamp into a readable string."""

    date_format = "%-m/%-d/%Y %-I:%M %p"
    if weekday:
        date_format += " (%A)"
    return timestamp.strftime(date_format)