| 262 | |
| 263 | == Date and Time Manipulations == |
| 264 | |
| 265 | Since r3935, Trac uses `datetime` objects internally, instead of timestamps. |
| 266 | More precisely, the database layer still uses `int` timestamps, but manipulation of time values is now done on `datetime` objects as soon as possible, see e.g. the [source:trunk/trac/Timeline.py Timeline] module. |
| 267 | |
| 268 | Those `datetime` values are directly added by the controllers to the data model, and it's the responsibility of the ''templates'' to pick up the appropriate time representation, using one of the built-in date formatting utilities: `format_date`, `format_datetime`, `format_datetime`, `http_date`, `pretty_timedelta` (see [source:trunk/trac/chrome.py chrome.py]), or even the `$dateinfo()` macro. |
| 269 | |
| 270 | Those utilities automatically take into account the ''timezone'' information set by the user, so that the dates are presented in a meaningful way to him. |