from datetime import datetime def calc_days_ago(date, formatting): return (datetime.today().date() - datetime.strptime(date, formatting).date()).days