Opened 16 years ago

Closed 16 years ago

#9850 closed (fixed)

Outdated documentation - (date format strings)

Reported by: cezz Owned by: Tim Graham
Component: Documentation Version: dev
Severity: Keywords: now format strings
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Page http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now says that format string "U" is Not implemented, but it actually works for me using django 1.0.2 (it returns Unix timestamp)

Change History (7)

by Tim Graham, 16 years ago

Attachment: format_U.diff added

initial fix

comment:1 by Tim Graham, 16 years ago

Has patch: set
Owner: changed from nobody to Tim Graham
Status: newassigned
Triage Stage: UnreviewedReady for checkin
Version: 1.0SVN

comment:2 by Karen Tracey, 16 years ago

Triage Stage: Ready for checkinDesign decision needed

Before checking in a doc change that claims something works, we should first verify it works. Adding a testcase that attempts to use this formatting option would seem to be wise. Actually, based on #10318 and the associated django-users thread: http://groups.google.com/group/django-users/browse_thread/thread/5a156fbddee22d3b/e255ffea08bd3d4d, it appears the doc is more right than wrong here -- I can't see how the existing code is correct.

I don't know whether the right answer is to to fix the code to match the doc (raise NotImplemented there, as it used to before r992) or fix the implementation.

Note #10318 has a test, but that test fails on Windows due to strftime('%s') there returning an empty string rather then a number, so that test can't be directly used in our test suite.

comment:3 by Eric Holscher, 16 years ago

milestone: 1.1

Seems like this should be in 1.1 like #10825. Feel free to revert if not.

comment:4 by Malcolm Tredinnick, 16 years ago

milestone: 1.1

This isn't 1.1 material. Karen's comment indicates why: it's not a public feature at the moment and needs a bunch of work to fix things.

comment:5 by George Song, 16 years ago

Patch over at #10825 that incorporates changes for this ticket as well, since they go hand-in-hand.

comment:6 by Tim Graham, 16 years ago

Resolution: fixed
Status: assignedclosed

fixed: (In [10716]) Fixed #10825: fixed the 'U' format code to dateformat (and the date/now filter/tag).

Note: See TracTickets for help on using tickets.
Back to Top