|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.commons.DateUtils
public class DateUtils
This class contains common functions for comparing and converting values of type Date.
Method Summary | |
---|---|
static java.util.Date |
addDate(java.util.Date date,
int years,
int months,
int days)
Calculates a date relative to the supplied date. |
static java.lang.String |
formatDate(java.util.Date d,
java.util.Locale locale)
|
static java.lang.String |
formatDayOfWeek(java.util.Date d,
java.util.Locale locale,
boolean longFormat)
|
static java.lang.String |
formatMonth(java.util.Date d,
java.util.Locale locale,
boolean longFormat)
|
static java.lang.String |
formatMonth(int month,
java.util.Locale locale,
boolean longFormat)
|
static java.lang.String |
formatTime(java.util.Date d,
java.util.Locale locale,
boolean withSeconds)
|
static java.lang.String |
formatYear(java.util.Date d,
java.util.Locale locale)
|
static java.util.Date |
getDate(int year,
int month,
int day)
|
static java.util.Date |
getDateNow()
Returns the current date without time |
static java.util.Date |
getDateOnly(java.util.Date date)
|
static java.util.Date |
getDateTimeFromNow(boolean withTime,
int years,
int months,
int days)
returns a date relative from the current date. |
static java.util.Date |
getTimeNow()
Returns the current date and time |
static int |
getWeekOfYear(java.util.Date d,
java.util.Locale locale)
|
static java.util.Date |
parseDate(java.lang.String sDate,
java.util.Locale locale)
|
static java.util.Date |
setDate(java.util.Date date,
int year,
int month,
int day)
|
static java.util.Date |
setTime(java.util.Date date,
int hours,
int minutes,
int seconds,
int millis)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.util.Date getDateTimeFromNow(boolean withTime, int years, int months, int days)
withTime
- true if the current time should be added or false if only the date is desired.years
- number of years to add or subtract from the current datemonths
- number of months to add or subtract from the current datedays
- number of days to add or subtract from the current date
public static java.util.Date getDateNow()
public static java.util.Date getTimeNow()
public static java.util.Date addDate(java.util.Date date, int years, int months, int days)
date
- date to calculate fromyears
- number of years to add or subtract from the supplied datemonths
- number of months to add or subtract from the supplied datedays
- number of days to add or subtract from the supplied date
public static java.util.Date setDate(java.util.Date date, int year, int month, int day)
public static java.util.Date getDate(int year, int month, int day)
public static java.util.Date setTime(java.util.Date date, int hours, int minutes, int seconds, int millis)
public static java.util.Date getDateOnly(java.util.Date date)
public static java.util.Date parseDate(java.lang.String sDate, java.util.Locale locale)
public static java.lang.String formatDate(java.util.Date d, java.util.Locale locale)
public static java.lang.String formatTime(java.util.Date d, java.util.Locale locale, boolean withSeconds)
public static java.lang.String formatDayOfWeek(java.util.Date d, java.util.Locale locale, boolean longFormat)
public static java.lang.String formatMonth(java.util.Date d, java.util.Locale locale, boolean longFormat)
public static int getWeekOfYear(java.util.Date d, java.util.Locale locale)
public static java.lang.String formatMonth(int month, java.util.Locale locale, boolean longFormat)
public static java.lang.String formatYear(java.util.Date d, java.util.Locale locale)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |