i needed to know which is a better way of getting the current month in the 'mon' format.
1) new Date().toString().substring(4,7).toLowerCase()
2)String a[]={"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"}; int index=Calendar.getInstance().get(Calendar.MONTH); month=a[index];
Hi, you can do this using java.util.SimpleDateFormat class. Use the SimpleDateFormat constructor to specify the format you want to print out the date and use the format function on that SimpleDateFormat object by passing your input date object.You will get the date in the format specified in the constructor.Usually you give the Format as YYYY if you want to print year in 4 digits.Try that.Once you get the answer please let us know. If you have any doubts you cna ask.Hope this is helpful to you.