def timestamp_to_date(timestamp, return_as_string=False):
    """
    turn pandas timestamp into YYYY-MM-DD format
    """
    if return_as_string:
        return str(timestamp.strftime('%Y-%m-%d'))
    return timestamp.date()