Kebab file names

This commit is contained in:
Angelos Chalaris
2023-04-27 22:00:06 +03:00
parent b9c77eb413
commit f6a215e9e3
107 changed files with 0 additions and 0 deletions

23
snippets/days-from-now.md Normal file
View File

@ -0,0 +1,23 @@
---
title: Days from now
tags: date
cover: clutter
firstSeen: 2020-10-28T16:19:51+02:00
lastUpdated: 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)
```