|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.DateUtils
public class DateUtils
Library for manipulating dates.
| Field Summary | |
|---|---|
static String |
DEFAULT_PATTERN
|
static String |
MONTH_PATTERN
|
| Constructor Summary | |
|---|---|
DateUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
between(Date myDate,
Date beforeDate,
Date afterDate)
Check if the first date in argument is included between the two other dates. |
static Date |
createDate(int dd,
int mm,
int yy)
Create a new date from day, month and year (French version). |
static Date |
createDateAfterToday(int ddStep,
int mmStep,
int yyStep)
Create a new date after the current date (today) with modification on day, month and year. |
static boolean |
currentPeriod(Date beforeDate,
Date afterDate)
Check if the current date is between the two dates in argument. |
static String |
formatDate(Date date,
String pattern)
Format a date using the pattern in argument. |
static String |
formatDate(Date date,
String pattern,
Locale locale)
|
static int |
getDifferenceInDays(Date beginDate,
Date endDate)
Do the difference between the two dates in argument. |
static int |
getMonth(Date date)
Get the month value from a date (between 0 and 11). |
static String |
getMonthLibelle(int monthNumber)
Get libelle of the month corresponding to the number given in argument. |
static String |
getMonthLibelle(int monthNumber,
Locale locale)
Get libelle of the month corresponding to the number given in argument. |
static Date |
parseDate(String date,
String pattern)
Parse a date using the pattern in argument. |
static Date |
setFirstDayOfMonth(Date date)
Set the first day of month to the date in argument. |
static Date |
setLastDayOfMonth(Date date)
Set the last day of month to the date in argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_PATTERN
public static final String MONTH_PATTERN
| Constructor Detail |
|---|
public DateUtils()
| Method Detail |
|---|
public static String formatDate(Date date,
String pattern)
date - the date to formatpattern - the pattern to use
DateFormat
public static String formatDate(Date date,
String pattern,
Locale locale)
public static Date parseDate(String date,
String pattern)
throws ParseException
date - the String to parsepattern - the pattern to use
ParseException - for parsing errorsDateFormat
public static Date createDate(int dd,
int mm,
int yy)
dd - value of the day 1-31mm - value of the month 1-12yy - value of the year 0-9999
public static Date createDateAfterToday(int ddStep,
int mmStep,
int yyStep)
ddStep - nb days you want to increase from the current datemmStep - nb months you want to increase from the current dateyyStep - nb years you want to increase from the current date
public static Date setLastDayOfMonth(Date date)
date - Date to modify
public static Date setFirstDayOfMonth(Date date)
date - Date to modify
public static boolean between(Date myDate,
Date beforeDate,
Date afterDate)
myDate - the date to testbeforeDate - the first date of the period to testafterDate - the second date of the period to test
public static boolean currentPeriod(Date beforeDate,
Date afterDate)
beforeDate - the first date of the periodafterDate - the second date of the period
between(java.util.Date, java.util.Date, java.util.Date)public static int getMonth(Date date)
date - the date to extract month
public static int getDifferenceInDays(Date beginDate,
Date endDate)
beginDate - first dateendDate - second date
public static String getMonthLibelle(int monthNumber,
Locale locale)
monthNumber - between 1-12locale - Locale for language support
public static String getMonthLibelle(int monthNumber)
monthNumber - between 1-12
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||