Hi guys,

I am using Django 1.2 which a model has the following field

my_time = models.DateTimeField(default=datetime.datetime.now())

I don't use "auto_now_add=True" because I want it to be editable in admin.

To my horror, Django can't handle timezone.

When adding a new model, this field is using America/Chicago time, so I
changed settings.py TIMEZONE to None

Then it's using UTC time, when I click add a new model in Django model, it's
dislayed as UTC time

Then problem is, when I click the default datetime admin widget, the "Now"
button, it using my browser local time. When you save this model, it
actually saves your LOCAL time to database as UTC time

So this creates so much confusion to admin as well as user.

I think timezone should be handled in clien widget, because you really can
toUTCString() as well as tolocalTimeString() in javascript. The backend
should always send/recieve UTC time.

Besides, the time zone info browser sends to backend is not reliable and
incomplete.

Is there a fix for this?

Thanks!

Regards,
est

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to