Skip to content

Home

Days from now

Calculates the date of n days from today.

from datetime import timedelta, date

def days_from_now(n):
  return date.today() + timedelta(n)

days_from_now(5) # date(2020, 11, 02)

More like this

Start typing a keyphrase to see matching snippets.