Package org.apache.calcite.util
Class DateString
java.lang.Object
org.apache.calcite.util.DateString
- All Implemented Interfaces:
Comparable<DateString>
Date literal.
Immutable, internally represented as a string (in ISO format).
-
Constructor Summary
ConstructorDescriptionDateString
(int year, int month, int day) Creates a DateString for year, month, day values.DateString
(String v) Creates a DateString. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static DateString
fromCalendarFields
(Calendar calendar) Creates a DateString from a Calendar.static DateString
fromDaysSinceEpoch
(int days) Creates a DateString that is a given number of days since the epoch.int
Returns the number of days since the epoch.long
Returns the number of milliseconds since the epoch.int
hashCode()
toString()
-
Constructor Details
-
DateString
Creates a DateString. -
DateString
public DateString(int year, int month, int day) Creates a DateString for year, month, day values.
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<DateString>
-
fromCalendarFields
Creates a DateString from a Calendar. -
getDaysSinceEpoch
public int getDaysSinceEpoch()Returns the number of days since the epoch. -
fromDaysSinceEpoch
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
-