tiangolo / full-stack-fastapi-template

Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
MIT License
24.44k stars 4.12k forks source link

♻️ Replace deprecated utcnow() with now(timezone.utc) in utils module #1247

Open jalvarezz13 opened 3 days ago

jalvarezz13 commented 3 days ago

This pull request addresses the deprecation of the datetime.utcnow() function by replacing it with datetime.now(timezone.utc) in the utils module.

Before

from datetime import datetime
datetime.utcnow()

After

from datetime import datetime, timezone
datetime.now(timezone.utc)

Source: https://docs-python-org.translate.goog/3/library/datetime.html?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=es&_x_tr_pto=sc#datetime.datetime.utcnow