|
||||||||||
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 Date |
addDate(Date date,
int years,
int months,
int days)
Calculates a date relative to the supplied date. |
static String |
formatDate(Date d,
Locale locale)
|
static String |
formatDayOfWeek(Date d,
Locale locale,
boolean longFormat)
|
static String |
formatMonth(Date d,
Locale locale,
boolean longFormat)
|
static String |
formatMonth(int month,
Locale locale,
boolean longFormat)
|
static String |
formatTime(Date d,
Locale locale,
boolean withSeconds)
|
static String |
formatYear(Date d,
Locale locale)
|
static Date |
getDate(int year,
int month,
int day)
|
static Date |
getDateNow()
Returns the current date without time |
static Date |
getDateOnly(Date date)
|
static Date |
getTimeNow()
Returns the current date and time |
static int |
getWeekOfYear(Date d,
Locale locale)
|
static Date |
parseDate(String sDate,
Locale locale)
|
static Date |
setDate(Date date,
int year,
int month,
int day)
|
static Date |
setTime(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 Date getDateNow()
public static Date getTimeNow()
public static Date addDate(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 Date setDate(Date date, int year, int month, int day)
public static Date getDate(int year, int month, int day)
public static Date setTime(Date date, int hours, int minutes, int seconds, int millis)
public static Date getDateOnly(Date date)
public static Date parseDate(String sDate, Locale locale)
public static String formatDate(Date d, Locale locale)
public static String formatTime(Date d, Locale locale, boolean withSeconds)
public static String formatDayOfWeek(Date d, Locale locale, boolean longFormat)
public static String formatMonth(Date d, Locale locale, boolean longFormat)
public static int getWeekOfYear(Date d, Locale locale)
public static String formatMonth(int month, Locale locale, boolean longFormat)
public static String formatYear(Date d, Locale locale)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |