|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.SimpleDate
public class SimpleDate
This class represents a simple date. That means, it is not a timestamp like java.util.Date and it also starts with month 1 for January rather than with zero.
For convenience it also provides some commonly string representations.
| Constructor Summary | |
|---|---|
SimpleDate()
Initialize the new instance with default values (i.e. today's date). |
|
SimpleDate(java.util.Date date)
Initialize the new instance with a standard date object. |
|
SimpleDate(java.util.GregorianCalendar gregorianCalendar)
Initialize the new instance with a standard calendar. |
|
SimpleDate(int year,
int month,
int day)
Returns a Date object representing the given parameters. |
|
| Method Summary | |
|---|---|
java.lang.String |
asBritishString()
Returns the date in the format "dd/MM/yyyy" ("23/11/2002"). |
java.util.Date |
asDate()
Returns this date as Java Date object. |
java.lang.String |
asGermanString()
Returns the date in the format "dd.MM.yyyy" ("23.11.2002"). |
java.lang.String |
asISO8601String()
Returns the date in the format "yyyy-MM-dd" ("2002-11-23"). |
java.lang.String |
asSortString()
Returns the date in the format "yyyyMMdd" ("20021123"). |
java.lang.String |
asUSString()
Returns the date in the format "MM/dd/yyyy" ("11/23/2002"). |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object object)
|
boolean |
equals(java.lang.Object object)
|
int |
getDay()
Returns the day in month as integer (1..31). |
int |
getMonth()
Returns the month as integer (1 = January, ..., 12 = December). |
int |
getYear()
Returns the year as integer (1900..3000). |
int |
hashCode()
|
static SimpleDate |
parseBritishDate(java.lang.String dateString)
Creates a new SimpleDate from the given dateString which must conform to the format "dd/MM/yyyy". |
static SimpleDate |
parseGermanDate(java.lang.String dateString)
Creates a new SimpleDate from the given dateString which must conform to the format "dd.MM.yyyy". |
static SimpleDate |
parseISO8601Date(java.lang.String dateString)
Creates a new SimpleDate from the given dateString which must conform to the format "yyyy-MM-dd". |
static SimpleDate |
parseSortDate(java.lang.String dateString)
Creates a new SimpleDate from the given dateString which must conform to the format "yyyyMMdd". |
static SimpleDate |
parseUSDate(java.lang.String dateString)
Creates a new SimpleDate from the given dateString which must conform to the format "MM/dd/yyyy". |
java.lang.String |
toString()
Returns the date in the format "yyyy-MM-dd" ("2002-11-23"). |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleDate()
public SimpleDate(java.util.GregorianCalendar gregorianCalendar)
public SimpleDate(java.util.Date date)
public SimpleDate(int year,
int month,
int day)
year - The year of the date to createmonth - The month of the date to create (1-based, 1=January)day - The day of the date to create| Method Detail |
|---|
public static SimpleDate parseSortDate(java.lang.String dateString)
throws java.text.ParseException
java.text.ParseException
public static SimpleDate parseGermanDate(java.lang.String dateString)
throws java.text.ParseException
java.text.ParseException
public static SimpleDate parseBritishDate(java.lang.String dateString)
throws java.text.ParseException
java.text.ParseException
public static SimpleDate parseUSDate(java.lang.String dateString)
throws java.text.ParseException
java.text.ParseException
public static SimpleDate parseISO8601Date(java.lang.String dateString)
throws java.text.ParseException
java.text.ParseExceptionpublic int getYear()
public int getMonth()
public int getDay()
public java.lang.String asSortString()
public java.lang.String asISO8601String()
public java.lang.String asGermanString()
public java.lang.String asBritishString()
public java.lang.String asUSString()
public java.util.Date asDate()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(java.lang.Object object)
compareTo in interface java.lang.Comparable
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||