September 15th, 2002, 10:16 PM
how do i do a check to see if the string (in this case the date) user entered is in YYYY-MM-DD format. if it is not in this format, then it should convert to this format.
eg: user entered 16-09-2002, it should be converted to 2002-09-16.
however if the user entered 2002-09-16, then no conversion is needed.
pls help asap..
September 16th, 2002, 01:16 AM
September 16th, 2002, 01:36 AM
i dun really understand what the website is trying to do. can you show me the codes??
September 16th, 2002, 03:55 AM
You'll need to import java.text.SimpleDateFormat.
dateString = new SimpleDateFormat( "yyyy-MM-dd" ).format( new SimpleDateFormat.parse( "16-09-2002" ) );
September 16th, 2002, 07:40 PM
how come i get this error: Class java.text.SimpleDateFormat. parse not found, even though i have imported the SimpleDateFormat class???
September 16th, 2002, 11:31 PM
new SimpleDateFormat.parse( "16-09-2002" )
new SimpleDateFormat().parse( "16-09-2002" )