Ответ 1
SimpleDateFormat formatter = new SimpleDateFormat("EEEE', 'MMMM d', ' yyyy");
Должно ли это (один 'д' вместо двух)?
http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
Можно ли удалить "0" в январе 04, 2012?
В настоящее время я использую следующую Java для получения формата даты, например
Monday, January 04, 2012
Я хотел бы, чтобы он выглядел как
Monday, January 4, 2012
Date anotherCurDate = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("EEEE', 'MMMM dd', ' yyyy");
final String formattedDateString = formatter.format(anotherCurDate);
final TextView currentRoomDate = (TextView) this.findViewById(R.id.CurrentDate);
SimpleDateFormat formatter = new SimpleDateFormat("EEEE', 'MMMM d', ' yyyy");
Должно ли это (один 'д' вместо двух)?
http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
Вы можете получить строку без "0" перед номером, просто сделав это:
Calendar today = Calendar.getInstance();
// If you want the day/month in String format
String month = today.get(Calendar.MONTH)+"";
// If you want the day/month in Integer format
int monthInt = (int ) Integer.parseInt(month);