Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I recently learned that there is datetime.UTC which is an alias of datetime.timezone.utc

It helps a bit with the verbosity:

from datetime import datetime, UTC

datetime.now(UTC)



That's from 3.11 onwards.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: