> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Datetime Now Not Today

#### Sourcery refactoring id: `use-datetime-now-not-today`

#### Description

Replace calls to `datetime.datetime.today()` with `datetime.datetime.now()`.
They are functionally equivalent, but `now` is a more expressive name.

#### Before

```python
from datetime import datetime

print(datetime.today())
```

#### After

```python
from datetime import datetime

print(datetime.now())
```

#### Explanation

`datetime.datetime.today()` has a misleading name. It doesn't return a `date`
object as the name `today` would imply, but a `datetime` object containing the
current time. For this reason, the functionally equivalent
`datetime.datetime.now()` is preferred. (See the
[Python Standard Library Docs](https://docs.python.org/3/library/datetime.html#datetime.datetime.now)
.)
