public class DateBean extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
after(Date when)
是否在when之后
|
boolean |
before(Date when)
是否在when之前
|
String |
format(String pattern)
格式化时间
|
DateBean |
getDateOf(int field,
int delta)
add(Calendar.DAY_OF_MONTH, -5). |
Date |
getMidOfNightTime(int delta)
获取半夜23:59:59的毫秒数
|
Date |
getZeroTimestamp(int delta)
获取该时间戳对应的00:00:00.000的时间戳
|
Date |
toDate()
获取Date值
|
Date |
toSqlDate()
转为sqlDate
|
Time |
toTime()
转为time
|
Timestamp |
toTimestamp()
转为时间戳类型
|
public DateBean()
public DateBean(Date date)
public DateBean(long timeMillis)
public Date toDate()
public Timestamp toTimestamp()
public Time toTime()
public Date toSqlDate()
public boolean before(Date when)
when - 时间public boolean after(Date when)
when - 时间public DateBean getDateOf(int field, int delta)
add(Calendar.DAY_OF_MONTH, -5).
field - 是增加天数、小时、分钟、月、年delta - 差值,增加或减少的值public Date getZeroTimestamp(int delta)
delta - 天数,0为当天的public Date getMidOfNightTime(int delta)
delta - 天数,0为当天的Copyright © 2020. All rights reserved.