org.apache.commons.lang.time.DurationFormatUtils
来源:互联网 发布:手机导航需要网络吗 编辑:程序博客网 时间:2024/06/05 18:37
格式化日期间隔:
//代码片段:
Date date1 = new Date();
Date date2 = DateUtils.addWeeks(date1, -2);
String dura = DurationFormatUtils.formatDuration(date1.getTime()
- date2.getTime(), "d天H小时m分钟s秒");
System.out.println(DateFormatUtils.format(date1, "yyyy-MM-dd HH:mm:ss")
+ " 和 " + DateFormatUtils.format(date2, "yyyy-MM-dd HH:mm:ss")
+ " 相差: " + dura);
//运行结果:
2009-03-17 16:28:36 和 2009-03-03 16:28:36 相差: 14天0小时0分钟0秒
- org.apache.commons.lang.time.DurationFormatUtils
- org.apache.commons.lang.time.DateUtils
- org.apache.commons.lang.time.DateFormatUtils
- org.apache.commons.lang.time.DateUtils
- org.apache.commons.lang.time用法实例
- [Jakarta Commons笔记] org.apache.commons.lang.time
- org.apache.commons.lang.time 包中的工具类
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.ArrayUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.StringUtils
- org.apache.commons.lang.ArrayUtils
- org.apache.commons.lang-RandomStringUtils
- MFC窗体关闭那点事
- SAP Integration
- S5PV210开发板android后续要升级到2.2了,凭序列号就可免费升级了
- mysql常用命令(自己用的比较多的)
- org.apache.commons.lang.time.DateFormatUtils
- org.apache.commons.lang.time.DurationFormatUtils
- vim命令(自己用的比较多的)
- IOS4 UITableView详解
- zend framework的Bootstrap.php 可以任意配置文件目录结构
- org.apache.commons.collections.CollectionUtils
- Flex的数据绑定方式一览
- java示例3——Get the current method name
- vbs之路
- org.apache.commons.lang.math.NumberUtils