public class TimeResolver extends Object
| 构造器和说明 |
|---|
TimeResolver() |
| 限定符和类型 | 方法和说明 |
|---|---|
static TimeResolver |
getInstance() |
static void |
main(String[] args) |
Date |
minusDays(String calendarName,
Date baseTime,
long offset) |
Date |
minusHours(String calendarName,
Date baseTime,
long offset) |
Date |
minusMillis(String calendarName,
Date baseTime,
long offset) |
Date |
minusMinutes(String calendarName,
Date baseTime,
long offset) |
Date |
minusSeconds(String calendarName,
Date baseTime,
long offset) |
Date |
plusDays(String calendarName,
Date baseTime,
long offset) |
Date |
plusHours(String calendarName,
Date baseTime,
long offset) |
Date |
plusMillis(String calendarName,
Date baseTime,
long offset) |
Date |
plusMinutes(String calendarName,
Date baseTime,
long offset) |
Date |
plusSeconds(String calendarName,
Date baseTime,
long offset) |
Date |
plusTime(String calendarName,
long baseTimeStamp,
long offset,
TimeUnit timeUnit)
query offset accord to baseTimeStamp, if specify calendar, offset compute within calendar.
|
public static TimeResolver getInstance()
public Date plusTime(String calendarName, long baseTimeStamp, long offset, TimeUnit timeUnit) throws TimeOffsetException, com.mashape.unirest.http.exceptions.UnirestException
calendarName - calendar name, null if you don't have calendarbaseTimeStamp - baseTime in millisoffset - offset, negative or positivetimeUnit - offset time unitTimeOffsetExceptioncom.mashape.unirest.http.exceptions.UnirestExceptionpublic Date plusDays(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date plusHours(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date plusMinutes(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date plusSeconds(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date plusMillis(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date minusDays(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date minusHours(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date minusMinutes(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date minusSeconds(String calendarName, Date baseTime, long offset) throws Exception
Exceptionpublic Date minusMillis(String calendarName, Date baseTime, long offset) throws Exception
ExceptionCopyright © 2021. All rights reserved.