jayvynl / django-clickhouse-backend

Django clickhouse database backend.
MIT License
130 stars 21 forks source link

[Issue] #79

Closed PavelIgin closed 5 months ago

PavelIgin commented 8 months ago

How i can add timezone to DateTime64Field ???

jayvynl commented 8 months ago

Just set USE_TZ = True in settings.py, which is the default. Then time will have UTC timezone when retrieved from database. You can change time to local timezone with django timezone utils.

from django.utils import timezone

timezone.localtime(time)