Class Date

All Implemented Interfaces:
Serializable

public class Date extends TimeStamp
See Also:
  • Field Details

    • ZERO

      public static final Date ZERO
  • Constructor Details

    • Date

      public Date()
    • Date

      public Date(long timestamp)
    • Date

      public Date(TimeStamp o)
    • Date

      public Date(long timestamp, Instant epoch)
  • Method Details

    • getYear

      public int getYear()
      Get the year AD of this Date.
      Returns:
      the year number.
    • getMonth

      public int getMonth()
      Get the month of this Date. Values are 1-indexed meaning January=1, February=2, etc.
      Returns:
      the month number.
    • getDay

      public int getDay()
      Get the day of the month of this date.
      Returns:
      the day number.
    • getHour

      public int getHour()
      Get the hour of the day of this date.
      Returns:
      the hour number.
    • getMinute

      public int getMinute()
      Get the minute of the hour of this date.
      Returns:
      the minute number.
    • getSecond

      public int getSecond()
      Get the second of the minute of this date.
      Returns:
      the second number.
    • now

      public static Date now(SystemClock clock)
      Create a new instance of Date from the current time and epoch set in the system clock.
      Parameters:
      clock - The clock to reference.
      Returns:
      A constructed Date instance.
    • toString

      public String toString()
      Override the 'toString' method to produce an ISO-8601 compliant date/time string.
      Overrides:
      toString in class TimeStamp
    • fromString

      public static Date fromString(String s)
      Parse an ISO-8601 date/time string.
      Parameters:
      s - The input string
      Returns:
      an instance of Date representative of the input string.