Login

Converting a Flickr Datetime to a Python Datetime

Author:
obeattie
Posted:
February 27, 2007
Language:
Python
Version:
Pre .96
Tags:
flickr datetime
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

  1. Natural language date/time form fields by jdriscoll 8 years ago
  2. DateTimeFluxCapacitor by jbcurtin 4 years, 5 months ago
  3. Complete Persian DateTime Widget by serj1975 3 years, 7 months ago
  4. Creating custom time entries in Django Date widget by adiq 1 year, 1 month ago
  5. copyright_since by xplozive 6 years, 3 months ago

Comments

Please login first before commenting.