Android中的日期时间显示
2013-04-17 09:43
316 查看
(一)
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy年MM月dd日 HH:mm:ss");
Date curDate = new Date(System.currentTimeMillis());
String time = formatter.format(curDate);
(二)
final Calendar c = Calendar.getInstance();
String time = c.get(Calendar.YEAR)+"年"+c.get(Calendar.MONTH)+"月"+c.get(Calendar.DAY_OF_MONTH)+"日";
String time = cal.get(Calendar.DAY_OF_MONTH) +":"+cal.get(Calendar.HOUR_OF_DAY) +":"+cal.get(Calendar.MINUTE)
本人发布的内容均为学习中用过的代码,上传主要为了方便以后的复习和为他人提供一些方便,一些代码没有上下文,新学的朋友有不懂或存在问题的地方可以留言。
SimpleDateFormat formatter = new SimpleDateFormat ("yyyy年MM月dd日 HH:mm:ss");
Date curDate = new Date(System.currentTimeMillis());
String time = formatter.format(curDate);
(二)
final Calendar c = Calendar.getInstance();
String time = c.get(Calendar.YEAR)+"年"+c.get(Calendar.MONTH)+"月"+c.get(Calendar.DAY_OF_MONTH)+"日";
String time = cal.get(Calendar.DAY_OF_MONTH) +":"+cal.get(Calendar.HOUR_OF_DAY) +":"+cal.get(Calendar.MINUTE)
本人发布的内容均为学习中用过的代码,上传主要为了方便以后的复习和为他人提供一些方便,一些代码没有上下文,新学的朋友有不懂或存在问题的地方可以留言。
相关文章推荐
- Android——使用DatePicker和TimePicker显示当前日期和时间
- android对话框显示当前日期和时间
- Android 系列 2.10格式化显示的时间和日期
- android 字符串工具类 格式化日期字符串 拼接数组 判断字符串是否为空 转换时间显示 转换文件大小 获取中英文字符个数
- Android实时显示系统时间日期以及星期几
- Android入门(12)——使用DataPicker以及TimePicker显示当前日期和时间
- Android显示时间和日期的控件的使用总结
- android显示时间为几天前,几个月前,几年前及具体日期
- android 日期时间格式转换;软键盘显示消失;获取系统title
- Android显示时间和日期的控件的使用总结
- android开发笔记--时间控件只显示年月不显示日期【如有需要可以更为只显示月日不显示年份】
- Android多种方法显示当前日期和时间
- Android多种方法显示当前日期和时间
- 智能课程表Android版-日期和时间的动态显示(二)
- Android Calender显示日期与时间
- android—DatePicker 和TimePicker显示日期以及使用TimePickerDialog,DatePickerDialog来专门实现时间选择对话框
- 智能课程表Android版-日期和时间的动态显示(一)
- Android实用笔记——使用DataPicker和TimePicker显示当前日期和时间
- Android 时间选择器,如何让日期和时间显示成滚动样式
- android 时间,日期,各种不同显示的格式化工具