Hello,
Regards,
Antonis
Antonis Christofides +30-6979924665 (mobile)
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1999ec1e-9170-432e-adc0-71cab3dece6an%40googlegroups.com.
Hi,
not what you asked, but
from settings import TIME_ZONE
is an error. It happens to work in this case, but generally you should write
from django.conf import settings
and then use "settings.TIME_ZONE". In Django, "settings" isn't a module, it's an object. Django has some logic when populating that object with attributes. An obvious example is that you can django the DJANGO_SETTINGS_MODULES environment variable to specify a different settings file.
Now, regarding what you asked, the pytz documentation has the following warning:
Unfortunately using the tzinfo argument of the standard datetime constructors ‘’does not work’’ with pytz for many timezones.
I don't remember the correct way to do it, since I'm always confused by how pytz works, and also its usage is deprecated because of the existence of the new "zoneinfo" Python standard library module.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d1cfcde9-3d21-4918-8edf-b9366b1dfa33n%40googlegroups.com.