public class DateString extends Object implements Comparable<DateString>
Immutable, internally represented as a string (in ISO format).
| Constructor and Description |
|---|
DateString(int year,
int month,
int day)
Creates a DateString for year, month, day values.
|
DateString(String v)
Creates a DateString.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DateString o) |
boolean |
equals(@Nullable Object o) |
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 |
getDaysSinceEpoch()
Returns the number of days since the epoch.
|
long |
getMillisSinceEpoch()
Returns the number of milliseconds since the epoch.
|
int |
hashCode() |
Calendar |
toCalendar() |
String |
toString() |
public DateString(String v)
public DateString(int year,
int month,
int day)
public int compareTo(DateString o)
compareTo in interface Comparable<DateString>public static DateString fromCalendarFields(Calendar calendar)
public int getDaysSinceEpoch()
public static DateString fromDaysSinceEpoch(int days)
public long getMillisSinceEpoch()
public Calendar toCalendar()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.