|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.DateUtil
public class DateUtil
This class is intended to provide convenience methods around the java.util.Date class. It is not always necessary to fiddle around with the awkward GregorianCalendar and not everybody wants to use the deprecated methods of java.util.Date.
Be aware that this class always treats months 1-based NOT zero-based. That is: 1=January, 2=February, 3=March, ..., 12=December
| Method Summary | |
|---|---|
static DateUtil |
current()
Returns the only instance this class supports (design pattern "Singleton") |
java.util.Date |
newDate(int year,
int month,
int day)
Returns a Date object representing the given parameters. |
java.util.Date |
newDate(int year,
int month,
int day,
int hour,
int minute)
Returns a Date object representing the given parameters. |
java.util.Date |
newDate(int year,
int month,
int day,
int hour,
int minute,
int second)
Returns a Date object representing the given parameters. |
java.util.Date |
today()
Returns the current date |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static DateUtil current()
public java.util.Date newDate(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
public java.util.Date newDate(int year,
int month,
int day,
int hour,
int minute)
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 createhour - The hours (0-23)minute - The minutes (0-59)
public java.util.Date newDate(int year,
int month,
int day,
int hour,
int minute,
int second)
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 createhour - The hours (0-23)minute - The minutes (0-59)second - The seconds (0-59)public java.util.Date today()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||