No timezone support for TimeField
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.4|
|Severity:||Normal||Keywords:||timezone, datetime, datetimefield, timefield|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Django 1.4 does not store aware times for TimeField, it only does for DateTimeField. Its really annoying, as python datetime.time object does support TZINFO just like datetime.datetime objects.
Steps to reproduce:
In the view i have set the timezone to timezone.activate(timezone) and after that i used form's TimeInput field to get the time. Now when i store it, it does not make the conversion from the current timezone to default timezone (which is set to UTC), it just naive time object. If i follow the same steps with DateTimeField, it works as expected, the datetime is first converted from current timezone to default one and then stored to the db.
Postgres 9.1 with psycopg2 adapter