How can i format the date to be like this
Mon, 27 Nov 2011
public static String sFleTimeToDate(double ft) {
double date = ft / 10000 - 11644455600000L;
date += TimeZone.getDefault().getOffset((long) date);
return DateFormat.format("ddd, dd MMM yyyy", new Date((long) date)).toString();
}
but this function return
027, 27 Nov 2011
You can change your DateFormat.format to
DateFormat.format("EEE, dd MMM yyyy", new Date((long) date)).toString();
For getting day in week you have to use EEE
SimpleDateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy);
You can create any format as you desire just have a look at this
Tutorial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With