Which was introduced as part of fixing the following deprecation warnings (36):
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC)
Describe the solution you'd like
Take the Deprecation fix, but delay execution with created_at = lambda: datetime.datetime.now(datetime.UTC)
Is your feature request related to a problem? Please describe.
https://github.com/Subscribie/subscribie/issues/1336 broke
created_at
timestamps due toThis was caused by
created_at = database.Column(database.DateTime, default=datetime.utcnow)
Which was introduced as part of fixing the following deprecation warnings (36):
Describe the solution you'd like
Take the Deprecation fix, but delay execution with
created_at = lambda: datetime.datetime.now(datetime.UTC)
Describe alternatives you've considered
func.now()
exists but is not UTC by default.Additional context