Checking for valid date input and convert appropriately

Ferrous Cranus nikos.gr33k at gmail.com
Fri Feb 22 14:28:06 CET 2013


i made a liitle typo at the ned, i meant this:

if ( eval( datetime.strptime(date, '%d %m %Y')  ) ): 
     date = datetime.strptime(date, '%d %m %Y').strftime('%Y-%m-%d') 
else: 
     print( "Date wasn't entered properly" ) 



More information about the Python-list mailing list