The Date.getMonth(), getYear() methods etc are all deprecated (because they don't cope with time zones etc very well). But Vishal is right - using SimpleDateFormat is the easiest way to output Dates in the way you want.
narayana Ega wrote:I want ot get date format like "dd-mm-yy".The above code not giving correct output
And further to the other good advice: Are you sure you want that?
Your code would appear to be loading some sort of spreadsheet, in which case couldn't you just load it as a date? If it's something like Apache POI, then the display format should probably be specified by the cell format (if you can do that with POI), not by converting the date to a String.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here