how to get month name by using Calendar class
807606May 28 2007 — edited May 28 2007hi all
i am writing the program using Calendar Class. So i wrote following code
Date createddate =new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(createddate);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
month=month+1;
String result=month+" "+year
Output:
5 2007
But i want to print the month name like "May","January" instead of month number like 5,6 etc.
so is there any method in the Calendar class which will give me the name of the month.Or is there any alternative way to achive the same?[b]
Thanks in advance
Regards
andy