Prepare repository for merge

This commit is contained in:
Angelos Chalaris
2023-05-01 22:43:50 +03:00
parent ab1ea476c5
commit a5ca5190e5
169 changed files with 0 additions and 626 deletions

View File

@ -0,0 +1,23 @@
---
title: Days from now
type: snippet
tags: [date]
cover: clutter
dateModified: 2020-10-28T16:19:51+02:00
---
Calculates the date of `n` days from today.
- Use `datetime.date.today()` to get the current day.
- Use `datetime.timedelta` to add `n` days from today's date.
```py
from datetime import timedelta, date
def days_from_now(n):
return date.today() + timedelta(n)
```
```py
days_from_now(5) # date(2020, 11, 02)
```