pallets-eco / wtforms

A flexible forms validation and rendering library for Python.
https://wtforms.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.51k stars 395 forks source link

Would you consider adding timezone management to DateTimeField? #833

Open Colin-b opened 8 months ago

Colin-b commented 8 months ago

We store our values as UTC localized but we expect our clients to use another timezone that make more sense when using the interface.

Having the ability to specify a data timezone and a display timezone would be nice, but maybe this is too far fetched.

What do you think?

If you are open to the idea, I could draft a PR for this.

Thanks again

roshii commented 1 month ago

With datetime.utcnow() being deprecated and replaced by datetime.now(UTC), it becomes impossible to compare the latter with offset-naive datetimes provided through wtforms. If not addressed, this issue will likely make wtform not compatible with future python version