The value you have 20020805105735 is a correct date value if it is coming from a database. What the date function takes as an argument is a unix time as returned by the mktime function ( which represents the number of seconds since jan 1st 1970 ). I suggest that you use substr function or ereg to extract the parts that you need from the date above. It will give you your information right away. Otherwise you could take a look at ereg documentation on php.net which contains a nice example on how to split dates among the user comments. Simply use mktime if you require a timestamp value :
date( "Ymd", mktime( 10, 57, 35, 08, 05, 2002 ) );