For MySQL the Django docs say 
<https://docs.djangoproject.com/en/1.11/ref/databases/#time-zone-definitions>
:

If you plan on using Django’s timezone support 
> <https://docs.djangoproject.com/en/1.11/topics/i18n/timezones/>, use 
> mysql_tzinfo_to_sql 
> <https://dev.mysql.com/doc/refman/en/mysql-tzinfo-to-sql.html> to load 
> time zone tables into the MySQL database. This needs to be done just once 
> for your MySQL server, not per database.


I can't find any evidence that Django actually uses those tables?

Here 
<https://github.com/django/django/blob/master/django/db/backends/mysql/operations.py#L164>,
 
for example, is a snippet from adapt_datetimefield_value():

        # MySQL doesn't support tz-aware datetimes
>         if timezone.is_aware(value):
>             if settings.USE_TZ:
>                 value = timezone.make_naive(value, 
> self.connection.timezone)
>             else:
>                 raise ValueError("MySQL backend does not support 
> timezone-aware datetimes when USE_TZ is False.")


adapt_timefiled_value() is even simpler 
<https://github.com/django/django/blob/master/django/db/backends/mysql/operations.py#L188>
:

        # MySQL doesn't support tz-aware times
>         if timezone.is_aware(value):
>             raise ValueError("MySQL backend does not support 
> timezone-aware times.")


What am I missing? 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a3584f88-bd35-44b2-a5aa-2da201c50ae3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to