Re: comparing datetime with date
From: Peter Maas (peter_at_somewhere.com)
Date: 09/16/04
- Next message: Daniel Ellison: "Re: Ranting about the state of Python IDEs for Windows"
- Previous message: Alex Martelli: "Re: python: ascii read"
- In reply to: Diez B. Roggisch: "Re: comparing datetime with date"
- Next in thread: Diez B. Roggisch: "Re: comparing datetime with date"
- Reply: Diez B. Roggisch: "Re: comparing datetime with date"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Sep 2004 13:25:25 +0200
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')
-------------------------------------------------------------------
- Next message: Daniel Ellison: "Re: Ranting about the state of Python IDEs for Windows"
- Previous message: Alex Martelli: "Re: python: ascii read"
- In reply to: Diez B. Roggisch: "Re: comparing datetime with date"
- Next in thread: Diez B. Roggisch: "Re: comparing datetime with date"
- Reply: Diez B. Roggisch: "Re: comparing datetime with date"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|