python django에서 datetime 계산을 위해 delorean을 사용하고 있습니다. Python 어떻게 장고에서 표준 시간대 인식 날짜를 얻을 수 있습니까
http://delorean.readthedocs.org/en/latest/quickstart.html
이
내가now = Delorean(timezone=settings.TIME_ZONE).datetime
todayDate = now.date()
을 사용하고 무엇을하지만 난
RuntimeWarning: DateTimeField start_time received a naive datetime (2014-12-09 00:00:00) while time zone support is active.
내가 그것을 알고는
나는 또한 시도하는 방법을 알고 싶어이 경고를 얻을 이뿐 만 아니라todayDate = timezone.make_aware(now.date(), timezone=settings.TIME_ZONE)
는 내가 그것은 파이썬은 "시간대 인식 날짜의 개념이없는 당신이하는 date
개체 또는 datetime
목적으로 끝낼려고 노력하고 있는지 분명하지 않다이
AttributeError: 'datetime.date' object has no attribute 'tzinfo'
'Delorean'에서 작동하는 방법을 잘 모르지만 datetimes는 시간대를 인식 할 수 있습니다. –
https://docs.djangoproject.com/en/dev/topics/i18n/timezones/ – knbk