comparing datetime with date

Peter Maas peter at somewhere.com
Thu Sep 16 07:25:25 EDT 2004


Diez B. Roggisch schrieb:
>>datetime and date are different by implementation, not by meaning. Both
>>are time intervals.
> 
> 
> Neither of them is - they are discrete points in time, with different
> resolution.
> 
> There is a difference in saying "vacation starts at 9/9/2004" or "lets meet
> at 9/9/2004, 12:00" - even to non-programmers.

There are several meanings. A date is valid for 24 hours. If you think
of a date as point in time there is usually a time part of 0:00 silently
added. No matter which meaning you prefer: Evaluating 2004-09-16 ==
2004-09-16T3:14 as true is very surprising.

You could as well say that int(3) == 3.14 is true (disregarding the
fractional part of the second operand).

-- 
-------------------------------------------------------------------
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------



More information about the Python-list mailing list