Package io.jmix.core
Interface TimeSource
- All Known Implementing Classes:
TimeSourceImpl
public interface TimeSource
Global time source interface. Must be used everywhere instead of
new Date() and
System.currentTimeMillis()-
Method Summary
Modifier and TypeMethodDescriptionlongReturn current timestamp in milliseconds.Return current timestamp as Date instance.now()ReturnZonedDateTimefor current timestamp.
-
Method Details
-
currentTimestamp
Date currentTimestamp()Return current timestamp as Date instance.- Returns:
- current timestamp
-
currentTimeMillis
long currentTimeMillis()Return current timestamp in milliseconds.- Returns:
- number of milliseconds since 1970-01-01 00:00
-
now
ZonedDateTime now()ReturnZonedDateTimefor current timestamp.- Returns:
- ZonedDateTime
-