- 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 2 months ago
- find even number by Rajeev529 10 months, 2 weeks ago
- Form field with fixed value by roam 11 months ago
- New Snippet! by Antoliny0919 11 months, 2 weeks ago
- Add Toggle Switch Widget to Django Forms by OgliariNatan 1 year, 2 months ago
Comments
Please login first before commenting.