public class DateUtils
extends org.nutz.lang.Times
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DATE_FORMAT_DAY |
static String |
DATE_FORMAT_MONTH |
| 构造器和说明 |
|---|
DateUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Date |
addDays(Date base,
int days)
日期加减
|
static Date |
addDays(int days)
从今日开始的日期加减
|
static Date |
addSeconds(Date base,
long seconds)
增加秒
|
static Date |
addSeconds(long seconds)
增加秒
|
static double |
daysBetween(Date start,
Date end)
两个日期之间的天数差
|
static Date |
getDayEnd() |
static Date |
getDayEnd(Date d) |
static int |
getDayOfMonth() |
static Date |
getDayStart()
获取今日凌晨
|
static Date |
getDayStart(Date d)
获取当日凌晨
|
static Date |
getMonthEnd()
获取月末日期
|
static Date |
getMonthEnd(Date d)
获取月末日期
|
static String |
getMonthEndDate() |
static String |
getMonthEndDate(Date date) |
static Date |
getMonthStart()
获取月初日期
|
static Date |
getMonthStart(Date d)
获取月初日期
|
static String |
getMonthStartDate() |
static String |
getMonthStartDate(Date date) |
static String |
getSequence() |
static Date |
getWeekEnd(boolean startFromSunday)
获取当前日期的周结束(周日或者周六)
|
static Date |
getWeekEnd(boolean startFromSunday,
Date date) |
static Date |
getWeekStart(boolean startFromSunday)
获取当前日期的周开始(周一或者周日)
|
static Date |
getWeekStart(boolean startFromSunday,
Date date) |
static Date |
getYearEnd()
获取年末日期
|
static Date |
getYearEnd(Date d)
获取年末日期
|
static String |
getYearEndMonth() |
static String |
getYearEndMonth(Date date) |
static Date |
getYearStart()
获取元旦日期
|
static Date |
getYearStart(Date d)
获取元旦日期
|
static String |
getYearStartMonth() |
static String |
getYearStartMonth(Date date) |
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, yearDiffCurrpublic static Date addDays(Date base, int days)
base - 开始日期days - 增加天数 正数为之后日期负数为之前日期public static Date addDays(int days)
days - 增加天数 正数为之后日期负数为之前日期public static double daysBetween(Date start, Date end)
start - 开始日期end - 结束日期public static Date getDayStart()
public static Date getDayEnd()
public static Date getWeekEnd(boolean startFromSunday)
startFromSunday - 从周日开始计算周 标识public static Date getWeekStart(boolean startFromSunday)
startFromSunday - 从周日开始计算周 标识public static Date addSeconds(Date base, long seconds)
base - 基础时间seconds - 秒数public static Date addSeconds(long seconds)
seconds - 秒数public static Date getYearStart()
public static Date getYearEnd()
public static Date getMonthStart()
public static Date getMonthEnd()
public static String getSequence()
public static String getYearStartMonth()
public static String getYearEndMonth()
public static String getMonthStartDate()
public static String getMonthEndDate()
public static int getDayOfMonth()
Copyright © 2020. All rights reserved.