public class DefaultTimeService extends AbstractBusinessService implements TimeService
TimeServiceAbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultTimeService() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
getCurrentDateWithTimeNormalized()
Returns the adjusted current time relative to the time set by
TimeService.setCurrentTime(Date) with time part
normalized to 0. |
java.util.Date |
getCurrentTime()
Returns the adjusted current time relative to the time set by
TimeService.setCurrentTime(Date). |
long |
getTimeOffset()
Returns the time offset in milliseconds, which is the time difference between the system time when
TimeService.setCurrentTime(Date) is called and the argument passed to the TimeService.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 |
setI18nService(I18NService i18nService) |
void |
setTimeOffset(long timeOffsetMillis)
Set the time offset in milliseconds.
|
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, setTenantScope, writeReplacepublic void setCurrentTime(java.util.Date instant)
TimeServicesetCurrentTime in interface TimeServicepublic java.util.Date getCurrentTime()
TimeServiceTimeService.setCurrentTime(Date). If
TimeService.setCurrentTime(Date) was never called earlier, then current system time is returned.getCurrentTime in interface TimeServicepublic java.util.Date getCurrentDateWithTimeNormalized()
TimeServiceTimeService.setCurrentTime(Date) with time part
normalized to 0. If TimeService.setCurrentTime(Date) was never called earlier, then current system time is returned.getCurrentDateWithTimeNormalized in interface TimeServicepublic long getTimeOffset()
TimeServiceTimeService.setCurrentTime(Date) is called and the argument passed to the TimeService.setCurrentTime(Date)getTimeOffset in interface TimeServicepublic void resetTimeOffset()
TimeServiceTimeService.getTimeOffset() after calling this method will get a value of
0. This is equivalent to calling TimeService.setTimeOffset(long) with a zero value argument.resetTimeOffset in interface TimeServicepublic void setTimeOffset(long timeOffsetMillis)
TimeServiceTimeService.getCurrentTime() will return the system time plus
the offset.setTimeOffset in interface TimeServicetimeOffsetMillis - time offset in milliseconds. Use a negative value to adjust time backwards.public void setI18nService(I18NService i18nService)
Copyright © 2018 SAP SE. All Rights Reserved.