Menu

Commit [r5754]  Maximize  Restore  History

Provide a `to_datetime` utility function which can be used to convert from timestamps in various form (int, long and float) to `datetime` objects which are now used internally by Trac to represent dates (since [milestone:0.11]).

The various `trac.util.datefmt` utilities are using the above function so that they're robust w.r.t. non-migrated plugins, but they already document the stricter requirement to accept only `datetime` objects or `None` (the current time), which will be enforced in [milestone:0.12].

I also added a few unit tests.

Fixes #4547, based on Dave Abrahams' original patch.

cboos 2007-06-25

changed /trunk/trac/util/datefmt.py
changed /trunk/trac/util/tests/datefmt.py
/trunk/trac/util/datefmt.py Diff Switch to side-by-side view
Loading...
/trunk/trac/util/tests/datefmt.py Diff Switch to side-by-side view
Loading...
Auth0 Logo