Interface TimeService
- All Known Implementing Classes:
ClockTimeService
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A service for working with "current" time. The idea is to make it possible to switch in different implementations, e.g., for testing.
- Author:
- RealLifeDeveloper
-
Method Summary
Modifier and TypeMethodDescriptionnow()
Gives the current time as ajava.time.ZonedDateTime
object.
-
Method Details
-
now
ZonedDateTime now()Gives the current time as ajava.time.ZonedDateTime
object.- Returns:
- the current time
-