Skip to content

Instantly share code, notes, and snippets.

@ddahan
Last active January 4, 2017 16:47
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 ddahan/8b68c275ca60abf545a3dd5d67b747e3 to your computer and use it in GitHub Desktop.
Save ddahan/8b68c275ca60abf545a3dd5d67b747e3 to your computer and use it in GitHub Desktop.
def get_updated_time_or_datetime(time_or_datetime):
if time_or_datetime:
if is_naive(time_or_datetime):
return make_aware(time_or_datetime, timezone.utc) - timedelta(hours=2)
else:
return time_or_datetime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment