Skip to content

Instantly share code, notes, and snippets.

@cburgmer
Created June 1, 2011 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cburgmer/1002887 to your computer and use it in GitHub Desktop.
Save cburgmer/1002887 to your computer and use it in GitHub Desktop.
Using proper timezone information with SuRF
from datetime import datetime
# Get the UTC tzinfo object, alternatively use the solution from http://docs.python.org/library/datetime.html#tzinfo-objects
from pytz import utc
my_article = Article()
# Save timestamp "now" as UTC
my_article.dc_created = datetime.now(utc)
my_article.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment