UPDATE: Looks like this shortcut method does the same thing (as long as USE_TZ = True in your settings):
from django.utils import timezone | |
timezone.now() |
The following will create a timezone-aware datetime object:
import datetime | |
from django.utils.timezone import utc | |
now = datetime.datetime.utcnow().replace(tzinfo=utc) |
Read more here: https://docs.djangoproject.com/en/dev/topics/i18n/timezones/