Class DateString

java.lang.Object
org.apache.calcite.util.DateString
All Implemented Interfaces:
Comparable<DateString>

public class DateString extends Object implements Comparable<DateString>
Date literal.

Immutable, internally represented as a string (in ISO format).

  • Constructor Details

    • DateString

      public DateString(String v)
      Creates a DateString.
    • DateString

      public DateString(int year, int month, int day)
      Creates a DateString for year, month, day values.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(DateString o)
      Specified by:
      compareTo in interface Comparable<DateString>
    • fromCalendarFields

      public static DateString fromCalendarFields(Calendar calendar)
      Creates a DateString from a Calendar.
    • getDaysSinceEpoch

      public int getDaysSinceEpoch()
      Returns the number of days since the epoch.
    • fromDaysSinceEpoch

      public static DateString fromDaysSinceEpoch(int days)
      Creates a DateString that is a given number of days since the epoch.
    • getMillisSinceEpoch

      public long getMillisSinceEpoch()
      Returns the number of milliseconds since the epoch. Always a multiple of 86,400,000 (the number of milliseconds in a day).
    • toCalendar

      public Calendar toCalendar()