java - Format current date to show day of the week -


this question has answer here:

i want show current date in application this: thu, may 2, 2013

i have following code current date

calendar c = calendar.getinstance();  time time = new time(); time.set(c.get(calendar.day_of_month), c.get(calendar.month),              c.get(calendar.year)); 

how can format time object string need?

this want

calendar cal = calendar.getinstance(); simpledateformat sdf = new simpledateformat("eee, mmm d, yyyy"); string strdate = sdf.format(cal.gettime()); system.out.println("current date in string format: " + strdate); 

where strdate can displayed in textview or whatever


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -