开发者

How can I get the day of the specific date in java for android application development? [duplicate]

This question already has answers here: Closed 开发者_Go百科11 years ago.

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


  Date date1 = (new GregorianCalendar(2011 , Calendar.AUGUST, 28)).getTime(); 
   Format formatter = new SimpleDateFormat("EEEE"); 
    String s = formatter.format(date1);  //  s==Sunday 


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜