public final class Date extends Object implements Comparable<Date>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Date other) |
boolean |
equals(Object o) |
static Date |
fromYearMonthDay(int year,
int month,
int dayOfMonth)
Constructs a new Date instance.
|
int |
getDayOfMonth()
Returns day of month between 1 and 31 inclusive.
|
int |
getMonth()
Returns the month between 1 and 12 inclusive.
|
int |
getYear()
Returns the year.
|
int |
hashCode() |
static Date |
parseDate(String date) |
String |
toString() |
public static Date fromYearMonthDay(int year, int month, int dayOfMonth)
year
- must be greater than 0month
- must be between [1,12]dayOfMonth
- must be between [1,31]public static Date parseDate(String date)
date
- Data in RFC 3339 date format (yyyy-mm-dd).public int getYear()
public int getMonth()
public int getDayOfMonth()
public int compareTo(Date other)
compareTo
in interface Comparable<Date>
Copyright © 2017 Google. All rights reserved.