- Author:
- obeattie
- Posted:
- February 27, 2007
- Language:
- Python
- Version:
- Pre .96
- Score:
- 6 (after 6 ratings)
Though this may not be Django (just basic Python) this kind of thing sure does come in handy! Plus, it's super easy to edit for any datetime format you want to throw at it.
1 2 3 4 5 | def flickr_datetime_to_datetime(fdt):
from datetime import datetime
from time import strptime
date_parts = strptime(fdt, '%Y-%m-%d %H:%M:%S')
return datetime(*date_parts[0:6])
|
More like this
- csrf test by zukosdead 3 days, 21 hours ago
- find even number by Rajeev529 8 months, 2 weeks ago
- Form field with fixed value by roam 9 months, 1 week ago
- New Snippet! by Antoliny0919 9 months, 2 weeks ago
- Add Toggle Switch Widget to Django Forms by OgliariNatan 1 year ago
Comments
Please login first before commenting.