Intelligent Date & Time parsing

shakefu at gmail.com shakefu at gmail.com
Sat Mar 8 00:00:44 CET 2008


On Mar 7, 4:35 pm, Jeffrey Froman <jeff... at fro.man> wrote:
> shak... at gmail.com wrote:
> > I need
> > something to parse user input for a django app, and it's awesome to be
> > able to write "last monday", "a year ago", or "10pm tuesday" like
> > PHP's strtotime.
>
> Django comes with some pretty handy filters for doing this sort of
> formatting. Check out the "date", "now", "timesince" and "timeuntil"
> filters here:
>
> http://www.djangoproject.com/documentation/templates/#built-in-filter...
>
> Jeffrey

Very cool - that's definitely handy to know for the output side of
things. I was mostly interested in writing a custom widget for
handling datetime input, 'cause I can't imagine anyone being studious
enough to use the 2008-03-07 12:00:00 format all the time... besides,
it's hard to type! I'd much rather allow for users to just be able to
type "12pm today".

So much to learn, so little time!

Jacob



More information about the Python-list mailing list