暂时先上传这些,后续有机会再整理,该DateUtils为org.apache.commons.lang3.time.DateUtils
序号 | 方法名 | 返回值 | 英文注释 | 文字注释 |
1 | addDays(Date date, int amount)
| static Date | Adds a number of days to a date returning a new object | 在日期‘天’上添加数字amount(可为负数),返回日期类型 |
2 | addHours(Date date, int amount)
| static Date | Adds a number of hours to a date returning a new object | 在日期‘小时’上添加数字amount(可为负数),返回日期类型 |
3 | addMilliseconds(Date date, int amount)
| static Date | Adds a number of milliseconds to a date returning a new object. | 在日期‘毫秒’上添加数字amount(可为负数),返回日期类型 |
4 | addMinutes(Date date, int amount)
| static Date | Adds a number of minutes to a date returning a new object | 在日期‘分钟’上添加数字amount(可为负数),返回日期类型 |
5 | static Date | Adds a number of months to a date returning a new object | 在日期‘月份’上添加数字amount(可为负数),返回日期类型 | |
6 | addSeconds(Date date, int amount)
| static Date | Adds a number of seconds to a date returning a new object | 在日期‘秒’上添加数字amount(可为负数),返回日期类型 |
7 | static Date | Adds a number of weeks to a date returning a new object | 在日期‘星期’上添加数字amount(可为负数),返回日期类型 | |
8 | static Date | Adds a number of years to a date returning a new object | 在日期‘年’上添加数字amount(可为负数),返回日期类型 | |
9 | ceiling(Calendar date, int field)
| static Calendar | Gets a date ceiling, leaving the field specified as the most significant field | 返回一个Calendar,效果为得到一个日期类别(年、月、日、时、分、秒)的数字,例如:d为2017年3月21日;则:DateUtils.ceiling(d, Calendar.MONTH)是2017年4月1日0时0分0秒 |
10 |
| static Date | Gets a date ceiling, leaving the field specified as the most significant field | 同上,区别为参数和返回值为Date类型 |
11 | ceiling(Object date, int field)
| static Date | Gets a date ceiling, leaving the field specified as the most significant field | 同上,区别为参数为Object类型。注意该Object对象需要和Date、Calendar对象任一转换。 |