Skip to content

[BUG]: datetime.utcnow() Deprecation #139

@Acuspeedster

Description

@Acuspeedster

🐛 datetime.utcnow() Deprecation


name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: datetime.utcnow() deprecated and produces naive datetimes"
labels: bug
assignees: ''

⚡️ Describe the Bug

Template.created_at and FormSubmission.created_at use:

default_factory=datetime.utcnow

Python 3.12 deprecates datetime.utcnow().
It returns naive datetime objects (no tzinfo), causing:

  • Potential TypeError when compared to aware datetimes
  • Implicit UTC assumptions
  • Forward-compatibility risk

📉 Expected Behavior

Use timezone-aware UTC datetimes:

datetime.now(timezone.utc)

🕵️ Possible Fix

Replace utcnow() with a helper returning timezone-aware UTC datetime.

Metadata

Metadata

Labels

to-thinkMore time to think about, advantages and disadvantages of each

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions