Re: can't compare datetime.datetime to datetime.date

2014-01-28 Thread Rafał Szymański
Thank You so much. Best wishes Rafal W dniu poniedziałek, 27 stycznia 2014 15:43:59 UTC+1 użytkownik i...@simpler.co napisał: > > You're comparing pub_date, which is a datetime.date, to timezone.now(), > which is a datetime.datetime. Check the docs at > http://docs.python.org/2/library/datetime

Re: can't compare datetime.datetime to datetime.date

2014-01-27 Thread ian
You're comparing pub_date, which is a datetime.date, to timezone.now(), which is a datetime.datetime. Check the docs at http://docs.python.org/2/library/datetime.html for more. In order to convert timezone.now() to a date, just call timezone.now().date(), like: In [1]: from django.utils import

Re: can't compare datetime.datetime to datetime.date

2008-05-20 Thread Ben Firshman
The date() method of the datetime object is what you probably want. See the documentation: http://docs.python.org/lib/datetime-datetime.html Ben On 20 May 2008, at 09:56, vance ma wrote: > In django ;How to compare datetime.datetime and datetime.date > > --~--~-~--~~---