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 Type
    Method
    Description
    long
    Return current timestamp in milliseconds.
    Return current timestamp as Date instance.
    now()
    Return ZonedDateTime for 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

      Return ZonedDateTime for current timestamp.
      Returns:
      ZonedDateTime