java中DateTime类的使用
来源:互联网 发布:java 当前时间 年月日 编辑:程序博客网 时间:2024/06/05 17:04
1、 获取当前系统时间:DateTime.now(); 返回的是一个DateTime对象。
2、DateTime转换成Date
(1)DateTime.now().toDate();
(2)newDateTime("2014-10-29").toDate();
(3)new DateTime("2014-10-2915:19:23").toDate();
3、转换成字符串格式
(1)new DateTime(newDate()).toDateString(),返回的是 2014-10-29 这种格式的字符串
(2)new DateTime(newDate()).toDateTimeString(),返回的是2014-10-29 15:23:23 这种格式的字符串
(3new DateTime(new Date()).toDateTimeString("yyyy年MM月dd日");
(4)new DateTime(newDate()).toDateTimeString("yyyy年MM月dd日 hh时mm分ss秒");
0 0
- java中DateTime类的使用
- Pythondatetime模块中datetime类的使用
- C#中datetime的使用
- C#中datetime的使用
- C#中datetime的使用
- C#中datetime的使用
- C#中datetime的使用
- C#中datetime的使用
- C#中DateTime类型的使用
- python中datetime的比较方法使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- C# 中DateTime的各种使用
- SVN如何查看修改的文件记录
- BOM模型演示---method
- Listview嵌套CheckBOX 实现全选反选取消,并对选中项进行标记
- log4net使用详解
- hdu 2082 母函数模板
- java中DateTime类的使用
- 项目随笔_1
- Java properties文件的xml形式
- 解决JSP页面乱码问题(非页面设置,编译器编码问题)
- Adapter的使用
- Mac出现Operation not permitted
- 在更新yum时,http://mirrors.xxx.com/centos/%20releasever/os/$basearch/出错
- MyBatis三配置
- Fullscreen API 全屏显示网页