date / time

John Roth johnroth at ameritech.net
Wed Apr 3 06:21:57 EST 2002


"mixo" <mixo at beth.uniforum.org.za> wrote in message
news:3CAAD0D1.2040309 at beth.uniforum.org.za...
>
> Suppose there is a given date, 2002-03-01 (YYYY-MM-DD).
> How can you get the day (2002-02-28 ) before the given date and
> check that it is valid?
>

Convert it into some form that is representable in days,
subtract one day, and then convert it back. You don't need to
check validity then.

There's lots of ways of doing that, from the builtin date
functions to mxDateTime.

John Roth





More information about the Python-list mailing list