I have used getRelativeDateTimeString which is showing the maximum of 1 week elapsed time.
How to increase more than 1 week.
after the elapsed time it shows the normal date formatting like 11/14/2007, 8:20 AM, I want to show month name in a date like Nov/14/2007, 8:20 AM
or 14 Nov 2007, 8:20 AM
I expect output to be: Nov/14/2007, 8:20 AM
but the output is 11/14/2007, 8:20 AM
java.util.Date time = new java.util.Date((long) time1 * 1000);
int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | FORMAT_ABBREV_MONTH;
CharSequence mdate = DateUtils.getRelativeDateTimeString(context,time.getTime() , DateUtils.SECOND_IN_MILLIS, DateUtils.WEEK_IN_MILLIS, flags);
You can break it into two parts:
DateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.mmm'Z'");
getRelativeTimeSpanString
hope it helps, thanks