i tried to TruncDay in django to turn date into day format , i use mysql
version 8.0
with windows 10
this my settings.py
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
date = models.DateTimeField(auto_now_add=True)
MyModel.objects.annotate(day=TruncDay('date'))#others
and i tried to run mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql;
but it raise this error while i run this command in mysql shell
ERROR: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql' at line 1
i also downloaded times files https://dev.mysql.com/downloads/timezones.html
and also my django project raise this error also
Database returned an invalid datetime value. Are time zone definitions for your database installed?