Package org.openwms.common.tasks
Interface TimeProvider
- All Known Implementing Classes:
DefaultTimeProvider
public interface TimeProvider
A TimeProvider is able to provide dates and times.
- Author:
- Heiko Scherrer
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault Instant
now()
Returns the current date and time of the system considering the configured timezone.default Date
Returns the current date and time considering the configured timezone.default ZonedDateTime
Returns the current date and time considering the configured timezone.default ZonedDateTime
nowAsZonedDateTime
(ZoneId zoneId) Returns the current date and time considering the configured timezone.
-
Field Details
-
DATE_TIME_MILLIS_WITH_TIMEZONE
The format pattern for all date-time with milliseconds and timezone types.- See Also:
-
DATE_TIME_WITH_TIMEZONE
The format pattern for all date-time with timezone types.- See Also:
-
-
Method Details
-
nowAsDate
Returns the current date and time considering the configured timezone.- Returns:
- Timezone aware Date
-
nowAsZonedDateTime
Returns the current date and time considering the configured timezone.- Returns:
- Timezone aware DateTime
-
nowAsZonedDateTime
Returns the current date and time considering the configured timezone.- Parameters:
zoneId
- ZoneId- Returns:
- Timezone aware DateTime
-
now
Returns the current date and time of the system considering the configured timezone.- Returns:
- Timezone aware Date
-