# Renaming datetime.datetime to datetime.DateTime

**URL:** <https://discuss.python.org/t/renaming-datetime-datetime-to-datetime-datetime/26279>\
**Category:** Ideas\
**Created:** [April 27, 2023, 9:03pm UTC](https://discuss.python.org/t/renaming-datetime-datetime-to-datetime-datetime/26279 "2023-04-27T21:03:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hugovk](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/hugovk/32/14505_2.png) [@hugovk](https://discuss.python.org/u/hugovk)\
**Post date:** [April 28, 2023, 2:14am UTC](https://discuss.python.org/t/renaming-datetime-datetime-to-datetime-datetime/26279/4 "2023-04-28T02:14:27Z")

</div>

I follow the advice of @adamchainz:

> For these reasons, I use this import idiom and recommend you do too:
> 
> ```python
> import datetime as dt
> 
> ```
> 
> Rather than any of:
> 
> ```python
> import datetime
> 
> ```
> 
> ```python
> from datetime import datetime # or time, timezone
> 
> ```
> 
> Then in your code, `dt.datetime`, `dt.time`, and `dt.timezone` will be unambiguous.

> **[How I Import Python’s datetime Module - Adam Johnson](https://adamj.eu/tech/2019/09/12/how-i-import-pythons-datetime-module/)**
>
> Python’s datetime module risks a whole bunch of name confusion:

---

_[View the full topic](https://discuss.python.org/t/renaming-datetime-datetime-to-datetime-datetime/26279)._
