blarouche
asked on
Date problem... I am looking for today's date
Hi Experts
I don't know how to parse an int into a date format
I have to format 20061123 into a Date so that the next while statement will work :
try{
cal.setTime(format.parse(" " + "01-Jan-80"));
Date endDate = ?????
int j=0;
while(cal.getTime().before (endDate)) {
if (j==0){
test[j] = "All";
j++;
}else{
String text = format.format(cal.getTime( ));
test[j]= text;
cal.add(Calendar.DATE, 1);
j++;
}
}
}catch(ParseException exp){
}
I don't know how to parse an int into a date format
I have to format 20061123 into a Date so that the next while statement will work :
try{
cal.setTime(format.parse("
Date endDate = ?????
int j=0;
while(cal.getTime().before
if (j==0){
test[j] = "All";
j++;
}else{
String text = format.format(cal.getTime(
test[j]= text;
cal.add(Calendar.DATE, 1);
j++;
}
}
}catch(ParseException exp){
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SimpleDataFormat=SimpleDat eFormat
ASKER
You're fantastic !!!
thank you
thank you
:-)
Integer.valueOf would be better still
Integer.valueOf would be better still