0

Possible Duplicate:
Android: how to get the current day of the week (Monday, etc…) in user language?

I want to get the date of the specific day in java for android application development. eg. For Sunday 7.8.2011 14.8.2011 21.8.2011

Community
  • 1
  • 1
kyawsanwin
  • 23
  • 1
  • 2
  • 8

2 Answers2

3
  Date date1 = (new GregorianCalendar(2011 , Calendar.AUGUST, 28)).getTime(); 
   Format formatter = new SimpleDateFormat("EEEE"); 
    String s = formatter.format(date1);  //  s==Sunday 
Bhanu Krishnan
  • 3,726
  • 1
  • 20
  • 40
  • I think I want to get the result is opposite of this one. I mean four Sunday or five per one month and I want to get the date of each Sunday. Thanks for your consideration. – kyawsanwin Aug 30 '11 at 08:40
2

Take a look at the Calendar Class. You can instantiate it using the Calendar.getInstance() method.

http://download.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html

i think its something like this cal.get(Calendar.DAY_OF_WEEK)

CrackerJack9
  • 3,650
  • 1
  • 27
  • 48
sherif
  • 2,282
  • 19
  • 21