public interface TimeService
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
getCurrentDateWithTimeNormalized()
Returns the adjusted current time relative to the time set by
setCurrentTime(Date) with time part
normalized to 0. |
java.util.Date |
getCurrentTime()
Returns the adjusted current time relative to the time set by
setCurrentTime(Date). |
long |
getTimeOffset()
Returns the time offset in milliseconds, which is the time difference between the system time when
setCurrentTime(Date) is called and the argument passed to the setCurrentTime(Date) |
void |
resetTimeOffset()
Reset the time back to system time.
|
void |
setCurrentTime(java.util.Date instant)
Set the current time to the specified time instant.
|
void |
setTimeOffset(long timeOffsetMillis)
Set the time offset in milliseconds.
|
void setCurrentTime(java.util.Date instant)
java.util.Date getCurrentTime()
setCurrentTime(Date). If
setCurrentTime(Date) was never called earlier, then current system time is returned.java.util.Date getCurrentDateWithTimeNormalized()
setCurrentTime(Date) with time part
normalized to 0. If setCurrentTime(Date) was never called earlier, then current system time is returned.long getTimeOffset()
setCurrentTime(Date) is called and the argument passed to the setCurrentTime(Date)void resetTimeOffset()
getTimeOffset() after calling this method will get a value of
0. This is equivalent to calling setTimeOffset(long) with a zero value argument.void setTimeOffset(long timeOffsetMillis)
getCurrentTime() will return the system time plus
the offset.timeOffsetMillis - time offset in milliseconds. Use a negative value to adjust time backwards.Copyright © 2018 SAP SE. All Rights Reserved.