Python how can i get the timezone aware date in django
Question: I am using delorean for datetime calculation in python django.

<http://delorean.readthedocs.org/en/latest/quickstart.html>

This is what i am using

    
    
    now = Delorean(timezone=settings.TIME_ZONE).datetime
    todayDate = now.date()
    

But i get this warning

    
    
    RuntimeWarning: DateTimeField start_time received a naive datetime (2014-12-09 00:00:00) while time zone support is active.
    

I want to know how to make it aware

I also tried this as well

`todayDate = timezone.make_aware(now.date(), timezone=settings.TIME_ZONE)`
then i get this

`AttributeError: 'datetime.date' object has no attribute 'tzinfo'`


Answer: It's not clear whether you're trying to end up with a `date` object or a
`datetime` object, as Python doesn't have the concept of a "timezone aware
date".

To get a `date` object corresponding to the current time in the current time
zone, you'd use:

    
    
    from django.utils.timezone import localtime, now
    
    localtime(now()).date()
    

That is: you're getting the current timezone-aware `datetime` in UTC; you're
converting it to the local time zone (i.e. `TIME_ZONE`); and then taking the
date from that.

If you want to get a `datetime` object corresponding to 00:00:00 on the
current date in the current time zone, you'd use:

    
    
    localtime(now()).replace(hour=0, minute=0, second=0, microsecond=0)
    

Based on this and [your other
question](http://stackoverflow.com/questions/27308951/how-can-i-remove-the-
timezone-offset-from-datetime-in-python), I think you're getting confused by
the Delorean package. I suggest sticking with Django's and Python's datetime
functionality.

