<commit_before>---
---

### Helper modules
```shell
pip install python-dateutil
```

### Usage
```python
from django.utils import timezone
import datetime
from dateutil import tz, parser as dateparser

# Generating dates
mydate = datetime.datetime(2018, 5, 2, 10, 30)
datetime.datetime(2018, 6, 2).replace(tzinfo=timezone.utc)

fromtimestamp = datetime.datetime.fromtimestamp(1525069936)
fromisostring = datetime.datetime.strptime('2018-04-30', '%Y-%m-%d')

fromiso8601 = dateparser.parse('2018-04-30T06:37:10.751Z').replace(tzinfo=tz.tzutc()).astimezone(tz.tzlocal())
fromiso8601 = dateparser.parse('2018-04-30T06:37:10.751Z').replace(tzinfo=tz.gettz('UTC')).astimezone(tz.gettz('Asia/Tokyo'))

toiso8601 = mydate.isoformat()

# Generating strings
fulldate = mydate.strftime('%Y-%m-%d_%H-%M-%S')

now = datetime.datetime.now()
print(now)
print(now.year)
print(now.month)
print(now.day)

# Add a month to date
future_date = now.replace(day=1) + datetime.timedelta(days=32)<commit_msg>Add python note: datetime from iso format<commit_after>---
---

### Helper modules
```shell
pip install python-dateutil
```

### Usage
```python
from django.utils import timezone
import datetime
from dateutil import tz, parser as dateparser

# Generating dates
mydate = datetime.datetime(2018, 5, 2, 10, 30)
datetime.datetime(2018, 6, 2).replace(tzinfo=timezone.utc)

fromtimestamp = datetime.datetime.fromtimestamp(1525069936)
fromisoformat = datetime.datetime.fromisoformat('2011-11-04 00:05:23.283')
fromisostring = datetime.datetime.strptime('2018-04-30', '%Y-%m-%d')

fromiso8601 = dateparser.parse('2018-04-30T06:37:10.751Z').replace(tzinfo=tz.tzutc()).astimezone(tz.tzlocal())
fromiso8601 = dateparser.parse('2018-04-30T06:37:10.751Z').replace(tzinfo=tz.gettz('UTC')).astimezone(tz.gettz('Asia/Tokyo'))

toiso8601 = mydate.isoformat()

# Generating strings
fulldate = mydate.strftime('%Y-%m-%d_%H-%M-%S')

now = datetime.datetime.now()
print(now)
print(now.year)
print(now.month)
print(now.day)

# Add a month to date
future_date = now.replace(day=1) + datetime.timedelta(days=32)
{'fraction_non_alphanumeric': 0.16948334138097537, 'fraction_numerical': 0.08836310960888459, 'mean_word_length': 6.144827586206897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1202884', 'n_tokens_mistral': 884, 'n_tokens_neox': 754, 'n_words': 132}