Shabda Raaj <sha...@agiliq.com> writes: >> I'd expect it to be False. There will be a small amount of time between > the two invocations and the time will change > > Ok, that makes sense. Should have written a better test case. What about > this. > >>>> datetime.datetime(2013, 1, 1) == datetime.date(2013, 1, 1) > False >>>> datetime.datetime.today() == datetime.date.today() > False
I think that's reasonable. "Today" (10/Sep) is not equal to "right now" (10/Sep, 11:28 am). Makes sense no? However, >>> x, y = datetime.datetime(2013, 1, 1), datetime.date(2013, 1, 1) >>> x.date() == y True which is much more sensible. For what it's worth, I think this whole business of dates and times is a mess. -- Cordially, Noufal http://nibrahim.net.in _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers