public class Date extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
int |
day
The day of month.
|
static String[] |
DAY
The array of day names in a week
|
static int[] |
DAY_OF_MONTH
Maximum nubers of days in month in a not leapyear
|
int |
hour
The hour of day.
|
int |
min
The minutes of hour.
|
int |
month
The month.
|
static String[] |
MONTH
String array of month used for printing via
toString() method |
int |
sec |
String |
wDay
The day of week.
|
int |
year
The yaer.
|
| Constructor and Description |
|---|
Date(int aDay,
int aMonth,
int aYear)
Default constructor.
|
Date(int aDay,
int aMonth,
int aYear,
int aHour,
int aMin)
Default constructor.
|
Date(long aMillis)
Creates a new date object which correspongs to the given time in millis since 01.01.1970.
|
| Modifier and Type | Method and Description |
|---|---|
static Date |
currentDate()
Create a Date object for this moment
|
boolean |
equals(Object o) |
int |
getDay() |
int |
getDayOfWeek() |
int |
getHour() |
int |
getMin() |
int |
getMonth() |
String |
getW_day() |
int |
getYear() |
int |
hashCode() |
boolean |
isValid()
Returns true if this date is a valid date.
|
static boolean |
isValid(Date aD1)
Check date
|
static Date |
parse(String aDateStrg)
Parse date out from string
|
static Date |
parseLong(String aDateStrg,
char aCh)
Parse date with hors and minutes out from string
|
static Date |
parseShort(String aDateStrg,
char aCh)
Parse date without hors and minutes out from string
|
String |
toISO8601Date()
Returns this date as ISO8601 format.
|
String |
toISO8601Timestamp()
Returns the ISO8601 timestamp of this date.
|
long |
toMill() |
String |
toString()
Returns the string representation of this date.
|
public String wDay
nullpublic int day
public int month
public int year
public int hour
public int min
public int sec
public static final String[] MONTH
toString() methodpublic static final int[] DAY_OF_MONTH
public static final String[] DAY
public Date(int aDay,
int aMonth,
int aYear)
calcDay() function.aDay - the dayaMonth - the monthaYear - the yearpublic Date(int aDay,
int aMonth,
int aYear,
int aHour,
int aMin)
calcDay() function.aDay - the dayaMonth - the monthaYear - the yearpublic Date(long aMillis)
aMillis - public static Date currentDate()
public static boolean isValid(Date aD1)
aD1 - the date object to check itpublic boolean isValid()
public String toString()
public static Date parse(String aDateStrg)
aDateStrg - Source string to parse itpublic static Date parseLong(String aDateStrg, char aCh)
aDateStrg - Source string to parse itpublic static Date parseShort(String aDateStrg, char aCh)
aDateStrg - source string to parse itpublic long toMill()
public int getDay()
public int getDayOfWeek()
public int getHour()
public int getMin()
public int getMonth()
public String getW_day()
public int getYear()
public String toISO8601Timestamp()
public String toISO8601Date()
Copyright © 2010-2014 anotheria.net. All Rights Reserved.