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
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
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
> >
--~--~-~--~~---
3 matches
Mail list logo