[BangPypers] date range

Rory Hart hartror at gmail.com
Tue Feb 9 11:48:02 CET 2010


It is nice and easy thankfully.

datetime.date and datetime.datetime both support < > operators

So:

if startdate < date and date < enddate:

    print "date in range"


http://docs.python.org/library/datetime.html

On Tue, Feb 9, 2010 at 9:22 PM, Kenneth Gonsalves <lawgon at au-kbc.org> wrote:

> hi,
>
> any easy way of finding out whether a given date is between two other
> dates?
> --
> regards
> Kenneth Gonsalves
> Senior Project Officer
> NRC-FOSS
> http://nrcfosshelpline.in/web/
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers


More information about the BangPypers mailing list