Interface Clock

All Superinterfaces:
Serializable
All Known Implementing Classes:
SystemClock

@ThreadSafe public interface Clock extends Serializable
A clock that tells the current time in milliseconds or nanoseconds.

Clocks are technically serializable because they are either a stateless wrapper around the system clock, or for testing, are just a wrapper around a DateTime. This means that if you serialize a clock and deserialize it elsewhere, you won't necessarily get the same time or time zone -- what you will get is a functioning clock.

  • Method Summary

    Modifier and Type
    Method
    Description
    org.joda.time.DateTime
    Returns current time in UTC timezone.
  • Method Details

    • nowUtc

      org.joda.time.DateTime nowUtc()
      Returns current time in UTC timezone.