Link to home
Start Free TrialLog in
Avatar of blarouche
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){
          }
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SimpleDataFormat=SimpleDateFormat
Avatar of blarouche
blarouche

ASKER

You're fantastic !!!


thank you
:-)

Integer.valueOf would be better still