Class ClockImpl

java.lang.Object
net.avcompris.commons3.utils.ClockImpl
All Implemented Interfaces:
Clock

@Component public final class ClockImpl extends Object implements Clock
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.joda.time.DateTime
    now()
    This method uses Joda Time to return the current DateTime, always using UTC TimeZone.
    long
    This method uses Joda Time to return the current UNIX time in milliseconds.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClockImpl

      public ClockImpl()
  • Method Details

    • now

      public org.joda.time.DateTime now()
      This method uses Joda Time to return the current DateTime, always using UTC TimeZone.
      Specified by:
      now in interface Clock
      Returns:
      the current DateTime, with UTC TimeZone
    • nowMs

      public long nowMs()
      This method uses Joda Time to return the current UNIX time in milliseconds.
      Specified by:
      nowMs in interface Clock
      Returns:
      the current UNIX time, in milliseconds