How do i check if a string contains a valid date?
Ex, i have a string ="jan 6 15:15", I want to set the year to 2006, but only if it's not already a valid date as is the case.
so, the resulting string should be "jan 6 2006 15:15". but if the string already has a valid date, ex "jan 7 2005", I don't want to touch it.
I try to use the datetime.parse inside a try/catch, but i couldn't get it to fail.ÃÂ It keeps setting the date to now().
Has anyone done this before?
View Complete Post