public class Timepoint extends Object
注:若是按每秒单位生成的时间点在2068年后溢出
| 限定符和类型 | 字段和说明 |
|---|---|
static long |
BASE_TIME
2000-1-1的GMT毫秒时间点(用于作时间点的起点值)
|
| 构造器和说明 |
|---|
Timepoint(int unit)
构建计时间点发生器
|
| 限定符和类型 | 方法和说明 |
|---|---|
static Appendable |
formatTimestamp(long timestamp,
Appendable appender)
格式化为紧凑的GMT时区的时间戳,如:20140311T181509000
|
static Timepoint |
getInstance(int unit)
取得共享的时间点发生器
|
int |
getSteps()
未对时的步数
|
long |
getTime(int timepoint)
取得自1970年1月1日的GMT毫秒时间(Date.getTime())
|
int |
getTimepoint()
时间点
|
int |
getTimepoint(long time)
由GMT毫秒时间计算时间点
|
int |
getUnit()
时间点单位(秒)
|
String |
toString() |
public static final long BASE_TIME
public static Timepoint getInstance(int unit)
unit - 时间点精度/单位(秒)public int getTimepoint()
public int getUnit()
public int getSteps()
public int getTimepoint(long time)
time - 相对对GMT1970基准点的毫秒时间public long getTime(int timepoint)
timepoint - 时间点public static final Appendable formatTimestamp(long timestamp, Appendable appender)
timestamp - 时间戳(Date.getTime())appender - 把格式串追加至其Copyright © 2022. All rights reserved.