[Zope] Validating a Date

Peter Bengtsson mail@peterbe.com
Thu, 06 Mar 2003 00:28:13 +0000


At 02:01 2003-02-28 -0600, Edward Muller wrote:
>Does anyone know of a good module/product/hack that I can feed a date to
>and it will let me know if it's valid or not?
>
>It should check leap years ... end days of the month and the like...

try:
     ok_date = context.ZopeTime('2003/13/13')
     print "Yes, date OK"
except:
     print "No, not OK"

return printed


>Thanks in advance... :-)
>--
>Edward Muller
>
>Interlix - President
>
>Web Hosting - PC Service & Support
>Custom Programming - Network Service & Support
>
>Phone: 417-862-0573
>  Cell: 417-844-2435
>   Fax: 417-862-0572
>
>http://www.interlix.com
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://mail.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )