public final class DateTime
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
short |
day
日(月中的第几天)
|
short |
hours
小时(GMT+0),0-23
|
short |
minutes
分钟(0-59)
|
short |
month
月(1-12)
|
short |
seconds
秒钟(0-59)
|
short |
year
年(四位数,2013)
|
构造器和说明 |
---|
DateTime()
根据当前时间构造一个时间对象,注意:结果为UTC时间
|
DateTime(short hours,
short minutes,
short seconds,
short year,
short month,
short day)
自主构造时间对象
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
isValid()
该实例是否代表有效日期时间
|
void |
set(short hours,
short minutes,
short seconds,
short year,
short month,
short day)
设置类实例的相关字段
|
java.lang.String |
toString() |
long |
toTimestamp()
获取当前
DateTime 对象对应的标准UNIX时间戳 |
long |
toTimestamp(boolean needMilli)
获取当前
DateTime 对象对应的标准UNIX时间戳,可精确到毫秒 |
public short hours
public short minutes
public short seconds
public short year
public short month
public short day
public DateTime(short hours, short minutes, short seconds, short year, short month, short day)
hours
- 小时minutes
- 分钟seconds
- 秒year
- 年month
- 月day
- 日public DateTime()
public void set(short hours, short minutes, short seconds, short year, short month, short day)
hours
- 小时minutes
- 分钟seconds
- 秒year
- 年month
- 月day
- 日public long toTimestamp()
DateTime
对象对应的标准UNIX时间戳public long toTimestamp(boolean needMilli)
DateTime
对象对应的标准UNIX时间戳,可精确到毫秒needMilli
- 是否需要毫秒级时间public boolean isValid()
public java.lang.String toString()
toString
在类中 java.lang.Object
©Mapbar Engine Team;All Rights Reserved