|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.lessy.util.DateUtil
public class DateUtil
Utility-Methods around Date and Time
| Constructor Summary | |
|---|---|
DateUtil()
|
|
| Method Summary | |
|---|---|
static Date |
addDays(Date date,
int days)
|
static Date |
createDate()
Creates a date based on the actual date but without time-settings, so the time part of this date is 00:00:00.000 |
static Date |
createDate(int year,
int month,
int day)
Creates a date specified with the passed values |
static Calendar |
getCalendar(Date date)
Get a calendar |
static int |
getYear(Date date)
Gets the Year-Part from a date |
static void |
resetTimePart(Calendar calendar)
Sets the time part in a calendar to zero (Hours, Minutes, Seconds, Milliseconds) |
static Date |
resetTimePart(Date date)
Sets the time part of a date to zero |
static Date |
setTimeToEndOfDay(Date date)
Sets the time part to the last second of the day. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateUtil()
| Method Detail |
|---|
public static Date createDate(int year,
int month,
int day)
year - Yearmonth - Month (1-based, so 1 = Jan., 2 = Feb.)day - Day of the month
public static Date createDate()
public static void resetTimePart(Calendar calendar)
calendar - Calendar
NullPointerException - if calendar is nullpublic static Date setTimeToEndOfDay(Date date)
date - Date. If null the the actual date will be taken
public static Date resetTimePart(Date date)
date - Date
public static Calendar getCalendar(Date date)
date - a date or null
public static Date addDays(Date date,
int days)
public static int getYear(Date date)
date - Date to extract the year from. If null, then the actual year is returned
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||