Need to check date format

Hi,I am reading data from a excel file i have to read a cell that contains Datei have to check whether that date is in right format dd/mm/yyhow can i check that please helpBunty
[212 byte] By [bunty_indiaa] at [2007-11-26 22:50:18]
# 1
RTFMjava.text.SimpleDateFormat
tjacobs01a at 2007-7-10 12:11:26 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi,

actually you can try to parse the date you retreived from the excel file, if the parse is done successfully the format will be ok. and if not an exception will raise so you can handle it.

example:

try{

DateFormat formatter = new SimpleDateFormat("dd/mm/yy");

Date date = (Date)formatter.parse("01/03/02"); // pass here the string retreived from excel as date

} catch (ParseException e) {

//Your code for handling date format error

}

invokeLatera at 2007-7-10 12:11:26 > top of Java-index,Java Essentials,Java Programming...