Opened 16 years ago
Closed 16 years ago
#10318 closed (duplicate)
Template filter date format "U" produces a timestamp that is off by 10-14 days
Reported by: | Sean Brant | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When trying to format a date in a template with {{ mydate|date:"U"
}} the timestamp is off. Attached is a test case that first created a datetime object based on now then renders that in a template with the format "U"
and compares that to outputting the date in python with strftime('%s')
, this test fails. The next test outputs the date with the format "Y-m-d H:i:s"
and compares that to outputting the date in python with strftime(%F %T)
, this test passes. So it seems that only "U" is broken.
Attachments (1)
Change History (2)
by , 16 years ago
comment:1 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
We've already got #9850 reporting the docs/code mismatch here. We can use the one ticket for fixing the code, if the decision is to document this formatter and make it work properly.
Test case