I have one due_date variable as string we are declaring . we get the value from service as "2014-02-17T00:00:00:0" LIKE
but, i want the format like '17-FEB-14' as string why because i need to pass this value as string to another method.
how can i acheive it.
i wrote like this.
Expand|Select|Wrap|Line Numbers
- StringTokenizer st = new StringTokenizer(due_date, "T");
- String str = st.nextToken();
- SimpleDateFormat formatter5=new SimpleDateFormat("dd-MMM-yyyy");
- due_date2 = formatter5.format(str);
but i got error here, due_date2 = formatter5.format(str);
as can not pass object to date like