Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format date with day in Android?

Tags:

date

android

I want to set date in format like this,

Friday, March 4, 2012 3:15 AM

yes I am know about this

   SimpleDateFormat parseFormat = new SimpleDateFormat("MMMM dd,yyyy hh:mm a");
   Date date =new Date();
   String s = parseFormat.format(date);

but I don't know what is option to show day, please help me. Thanks!

like image 345
Jignesh Ansodariya Avatar asked Oct 15 '12 11:10

Jignesh Ansodariya


People also ask

How do I format day and date?

In traditional American usage, dates are written in the month–day–year order (e.g. September 15, 2022) with a comma before and after the year if it is not at the end of a sentence, and time in 12-hour notation (6:46 am).

How do you format a date?

The international standard recommends writing the date as year, then month, then the day: YYYY-MM-DD. So if both Australians and Americans used this, they would both write the date as 2019-02-03.


1 Answers

In your format string, use "E" for the short name (Sun, Mon, Tue, etc), or "EEEE" for the full words (Sunday, Monday, Tuesday, etc).

Also, see here.

like image 101
Todd Sjolander Avatar answered Sep 28 '22 20:09

Todd Sjolander