Skip to content
Snippets Groups Projects
Commit bf51c8cd authored by Piotr Gawron's avatar Piotr Gawron
Browse files

midnight is timezone aware

parent fc855e1f
No related branches found
No related tags found
1 merge request!60Resolve "Export to Excel"
# coding=utf-8
import datetime
from django.utils import timezone
from django.contrib.auth.models import User, AnonymousUser
from django.db.models import Count, Case, When
......@@ -239,6 +240,6 @@ def get_filter_locations(user):
def get_today_midnight_date():
today = datetime.datetime.now()
today_midnight = datetime.datetime(today.year, today.month, today.day)
today = timezone.now()
today_midnight = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo)
return today_midnight
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment