Hi I have a string with a value "12-12-03" or a string which contain a date in the above format. I want to convert 12-12-03(which is a String ) into 12-Dec-03 format. If anybody knows the simple way to do this please help me . This is a small outline what i am doing String startdate=objForm.getStartDate(); ArrayList paramList=new ArrayList(); paramList.add(0,startdate); The value in the String startDate will be in the format i mentioned above which i have to convert as 12-dec-03 format before adding into the ArrayList. So Please help me . Thanks in advance
A hint - you might use two SimpleDateFormat objects - one to specify your input format for parsing, and another to specify your output format. For a completely different approach, you might break your input string on dashes into three strings (see StringTokenizer), look up the "Dec" string using the "12" string (see Map) and then put the parts back together. Let us know how it works out!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi