程序包 tech.riemann.etp
类 DateUtils
java.lang.Object
org.nutz.lang.Times
tech.riemann.etp.DateUtils
public class DateUtils
extends org.nutz.lang.Times
- 作者:
- Kerbores(kerbores@riemann.tech)
-
嵌套类概要
从类继承的嵌套类/接口 org.nutz.lang.Times
org.nutz.lang.Times.TmInfo -
字段概要
字段从类继承的字段 org.nutz.lang.Times
T_1D, T_1H, T_1M, T_1MS, T_1S, T_1W -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static DateaddDays(int days) 从今日开始的日期加减static Date日期加减static DateaddSeconds(long seconds) 增加秒static DateaddSeconds(Date base, long seconds) 增加秒static doubledaysBetween(Date start, Date end) 两个日期之间的天数差static Datestatic Datestatic intstatic Date获取今日凌晨static DategetDayStart(Date d) 获取当日凌晨static Date获取月末日期static DategetMonthEnd(Date d) 获取月末日期static Stringstatic StringgetMonthEndDate(Date date) static Date获取月初日期static Date获取月初日期static Stringstatic StringgetMonthStartDate(Date date) static Stringstatic DategetWeekEnd(boolean startFromSunday) 获取当前日期的周结束(周日或者周六)static DategetWeekEnd(boolean startFromSunday, Date date) static DategetWeekStart(boolean startFromSunday) 获取当前日期的周开始(周一或者周日)static DategetWeekStart(boolean startFromSunday, Date date) static Date获取年末日期static DategetYearEnd(Date d) 获取年末日期static Stringstatic StringgetYearEndMonth(Date date) static Date获取元旦日期static DategetYearStart(Date d) 获取元旦日期static Stringstatic StringgetYearStartMonth(Date date) 从类继承的方法 org.nutz.lang.Times
afterDay, ams, ams, befoDay, between, C, C, C, countLeapYear, D, D, D1970, d2TS, dayDiff, dayDiffCurr, format, format, formatForRead, fromMillis, fromMillisCN, getAstro, getDateByNum, getDay, getDayNum, getDaysOfMonth, getDaysOfMonth, getFirstDayOfMonth, getLastDayOfMonth, getMonth, getNowSDT, getToday, getToMonth, getToYear, getTS, getYear, isDate, leapYear, ms, ms, ms, ms, ms, mss, nextDay, nextDay, nextHour, nextMinute, nextMonth, nextSecond, nextWeek, nextYear, now, parse, parse, parseq, parseq, sD, sDT, sDT2TS, sDTcompare, sDTms, sDTms2, sDTms4, sec, sec, secs, sT, sTmin, sTms, T, T, Ti, Ti, Tims, toMillis, ts2D, ts2S, week, week, weeks, weeks, yearDiff, yearDiffCurr
-
字段详细资料
-
DATE_FORMAT_MONTH
- 另请参阅:
-
DATE_FORMAT_DAY
- 另请参阅:
-
-
构造器详细资料
-
DateUtils
public DateUtils()
-
-
方法详细资料
-
addDays
日期加减- 参数:
base- 开始日期days- 增加天数 正数为之后日期负数为之前日期- 返回:
- 目标日期
-
addDays
从今日开始的日期加减- 参数:
days- 增加天数 正数为之后日期负数为之前日期- 返回:
- 目标日期
-
daysBetween
两个日期之间的天数差- 参数:
start- 开始日期end- 结束日期- 返回:
- 天数
-
getDayStart
获取当日凌晨- 参数:
d- 日期- 返回:
- 当日凌晨 date 对象
-
getDayEnd
-
getDayStart
获取今日凌晨- 返回:
- 今日凌晨0:0:0的时间实例
-
getDayEnd
-
getWeekEnd
获取当前日期的周结束(周日或者周六)- 参数:
startFromSunday- 从周日开始计算周 标识- 返回:
- startFromSunday 为true 则返回下一个周六 为false则返回下一个周日
-
getWeekEnd
-
getWeekStart
获取当前日期的周开始(周一或者周日)- 参数:
startFromSunday- 从周日开始计算周 标识- 返回:
- startFromSunday 为true 则返回上一个周日 为false则返回上一个周一
-
getWeekStart
-
addSeconds
增加秒- 参数:
base- 基础时间seconds- 秒数- 返回:
- 日期对象
-
addSeconds
增加秒- 参数:
seconds- 秒数- 返回:
- 日期对象
-
getYearStart
获取元旦日期- 参数:
d- 日期- 返回:
- 元旦日期
-
getYearStart
获取元旦日期- 返回:
- 元旦日期
-
getYearEnd
获取年末日期- 参数:
d- 日期- 返回:
- 年末日期
-
getYearEnd
获取年末日期- 返回:
- 年末日期
-
getMonthStart
获取月初日期- 参数:
d- 日期- 返回:
- 月初日期
-
getMonthStart
获取月初日期- 返回:
- 月初日期
-
getMonthEnd
获取月末日期- 参数:
d- 日期- 返回:
- 月末日期
-
getMonthEnd
获取月末日期- 返回:
- 月末日期
-
getSequence
-
getYearStartMonth
-
getYearStartMonth
-
getYearEndMonth
-
getYearEndMonth
-
getMonthStartDate
-
getMonthStartDate
-
getMonthEndDate
-
getMonthEndDate
-
getDayOfMonth
public static int getDayOfMonth()
-