Android编程权威指南,8.6挑战练习 日期格式化
参考代码: http://developer.android.com/intl/zh-cn/reference/java/text/SimpleDateFormat.html
String format = new String("yyyy-MM-dd HH:mm");
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.CHINA);
String dateFormat = sdf.format(mCrime.getDate());
mDateButton.setText(dateFormat);
//mDateButton.setText(mCrime.getDate().toString());
更好的解决办法
google:android programming challenge solutions
来源:http://forums.bignerdranch.com/viewtopic.php?f=405&t=6443
mDateButton.setText(DateFormat.format("EEEE,MMM dd, yyyy",mCrime.getDate()).toString());