On Thu, Nov 6, 2008 at 1:27 PM, Eric Dorsey <[EMAIL PROTECTED]> wrote:

> Greetings,I have a program where I ask a user to enter a date in format
> YYYY-MM-DD, and get a string like: '2008-10-25'
>
> Can anyone tell me how I would verify this is a real date before allowing
> it to be passed on to the next part of the program?
>

I guess it depends on what your definition of "real date" is... Should the
year fall in a certain range? How about the month and day?

Are you going to require - between each element? Do you know how to split a
string and convert the elements to integers?

That should give you some clues to your solution...
HTH,
Wayne
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to