java 常用时间格式
2010-10-21 23:53
337 查看
日历表的方式
Calendar now = Calendar.getInstance();
String time = now.get(Calendar.YEAR) + "-"
+ (now.get(Calendar.MONTH) + 1) + "-"
+ now.get(Calendar.DAY_OF_MONTH) + " "
+ now.get(Calendar.HOUR_OF_DAY) + ":"
+ now.get(Calendar.MINUTE) + ":" + now.get(Calendar.SECOND);
简单的时间格式
SimpleDateFormat formate=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String nowDate=formate.format(new Date());
Calendar now = Calendar.getInstance();
String time = now.get(Calendar.YEAR) + "-"
+ (now.get(Calendar.MONTH) + 1) + "-"
+ now.get(Calendar.DAY_OF_MONTH) + " "
+ now.get(Calendar.HOUR_OF_DAY) + ":"
+ now.get(Calendar.MINUTE) + ":" + now.get(Calendar.SECOND);
简单的时间格式
SimpleDateFormat formate=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String nowDate=formate.format(new Date());
相关文章推荐
- Java中常用的一种时间格式的转换方法
- 自定义事件格式--常用的 Java编写的各种时间格式类
- JAVA常用时间类及ORACLE的时间格式
- java 常用时间格式转化
- java时间格式大全(算法源码)
- java的String、timestamp、Date、秒数等各种时间格式相互转换
- Java获取各种常用时间方法(工具类)
- Java常用的时间处理
- mysql将时间戳转成常用可读时间格式
- Linux-shell常用时间格式
- java时间日期格式总结(一)
- Java判断时间,Email,手机号是否为正确格式
- Java获得不同格式的系统时间
- 遇到的问题------------时间格式转化时java.text.ParseException: Unparseable date: ""异常
- Java各种获取系统当前时间方法 和 格式
- 主题:Java获取各种常用时间方法
- JAVA一些常用的时间操作
- 四、java-常用时间转换
- Java时间格式(SQL)
- java学习时间格式