datetime.time and midnight

Paddy3118 paddy3118 at googlemail.com
Sun Feb 22 06:51:10 CET 2009


On Feb 21, 10:44 pm, Ethan Furman <et... at stoneleaf.us> wrote:
> Greetings, List!
>
> I was curious if anyone knew the rationale behind making midnight False?
>
> --> import datetime
> --> midnight = datetime.time(0,0,0)
> --> bool(midnight)
> False
>
> To my way of thinking, midnight does actually exist so it should be
> true.  If datetime.time was measuring an *amount* of time, rather than a
> certain point during the day, then a time of 0:0:0 should certainly be
> False as it would mean no time had passed.  However, since midnight does
> indeed exist (as many programmers have observed when deadlines approach
> ;) I would think it should be true.
> --
> ~Ethan~

Ethan,
Knights are true and seek the light. Evil trolls seek the night and so
their hour is false.

;-)

- Paddy.



More information about the Python-list mailing list