|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.stock.utils.DateUtils
public final class DateUtils
Classe utilitaire pour la manipulation des dates
Field Summary | |
---|---|
static int |
DATE_CRITERE_ENTRE_LE
|
static int |
DATE_CRITERE_ET_LE
|
static int |
DATE_CRITERE_OU_LE
|
static java.lang.String |
XML_DATE_FORMAT
|
Method Summary | |
---|---|
static java.lang.String |
converteDateAnglais(java.lang.String dateAnglaise)
Convertis une date depuis le format dd/MM/yyyy vers le format dd-MM-yyyy. |
static java.lang.String |
getAnnee(java.util.Date date)
Retourne l'année d'une date |
static int |
getAnneeEnCours()
Retourne l'année en cours |
static java.sql.Timestamp |
getCurrentDate()
Retourne la date du jour |
static java.lang.String |
getCurrentDateString()
renvoie la date courante. |
static java.lang.String |
getCurrentDateString(java.lang.String strPattern)
renvoie la date courante |
static java.lang.String |
getDate(java.util.Date date,
java.lang.String strPattern)
Renvoie la date sous le format défini par strPattern |
static java.sql.Timestamp |
getDate(java.lang.String strDate,
boolean isStartOfDayHour)
Transfome une date en format string de type dd/MM/yyyy en objet Timestamp |
static java.sql.Timestamp |
getDate(java.sql.Timestamp date,
boolean isStartOfDayHour)
Renvoie un timestamp dont l'heure doit etre 00h01 FALSE si l'heure doit etre 23H59 |
static java.lang.String |
getDate(java.sql.Timestamp date,
java.lang.String strPattern)
Renvoie la date sous le format défini par strPattern |
static java.sql.Timestamp |
getDateFirstMinute(java.util.Date date)
return a timestamp Object which correspond with the string specified in parameter. |
static java.lang.String |
getDateFr(java.util.Date date)
Return string for date dd/MM/yyyy |
static java.sql.Timestamp |
getDateLastMinute(java.util.Date date)
return a timestamp Object which correspond with the string specified in parameter. |
static java.sql.Timestamp |
getHour(java.lang.String strHour)
Transfome une date en format string de type HH:mm en objet Timestamp |
static java.lang.String |
getHourFr(java.util.Date date)
Return string for date HH:mm |
static java.util.Date |
getHourWithoutDate(java.util.Date hour)
Get a timestamp with hour setted and date 01/01/1970. |
static java.util.Date |
mergeDateHour(java.util.Date date,
java.util.Date hour)
Set the given date hour with the given hour. |
static boolean |
validateDate(java.lang.String date)
Validate a date |
static boolean |
valideDateEntreLeEtLeOuLe(java.util.List<java.lang.String> dateEffetRecherche,
boolean obligatoire)
vérifie un trigramme de dates entre le ... et le ... ou le. |
static boolean |
verifierHeure(java.lang.String sHeure)
Vérifie que l'heure est bien au format HH:mm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DATE_CRITERE_ENTRE_LE
public static final int DATE_CRITERE_ET_LE
public static final int DATE_CRITERE_OU_LE
public static final java.lang.String XML_DATE_FORMAT
Method Detail |
---|
public static java.sql.Timestamp getDate(java.lang.String strDate, boolean isStartOfDayHour)
strDate
- Date à transformerisStartOfDayHour
- TRUE si l'heure doit etre 00h01 FALSE si l'heure
doit etre 23H59
public static java.lang.String getDate(java.sql.Timestamp date, java.lang.String strPattern)
date
- la datestrPattern
- le format souhaite de la date
public static java.lang.String getDate(java.util.Date date, java.lang.String strPattern)
date
- la datestrPattern
- le format souhaite de la date
public static java.lang.String getDateFr(java.util.Date date)
date
- the date
public static java.lang.String getHourFr(java.util.Date date)
date
- the date
public static java.sql.Timestamp getCurrentDate()
public static java.lang.String getCurrentDateString(java.lang.String strPattern)
strPattern
- Le format de la date courante
public static java.lang.String getCurrentDateString()
public static java.sql.Timestamp getDate(java.sql.Timestamp date, boolean isStartOfDayHour)
date
- Date à transformerisStartOfDayHour
- true si l'heure doit etre 00h01 FALSE si l'heure
doit etre 23H59
public static int getAnneeEnCours()
public static java.lang.String converteDateAnglais(java.lang.String dateAnglaise) throws java.text.ParseException
dateAnglaise
- date au format dd/MM/yyyy
java.text.ParseException
- lancé si la date en entrée n'est pas valide.public static boolean verifierHeure(java.lang.String sHeure)
sHeure
- string heure
public static java.lang.String getAnnee(java.util.Date date)
date
- date
public static boolean validateDate(java.lang.String date)
date
- la date
public static boolean valideDateEntreLeEtLeOuLe(java.util.List<java.lang.String> dateEffetRecherche, boolean obligatoire)
dateEffetRecherche
- the date effet rechercheobligatoire
- si obligatoire est à true la méthode vérifiera
aussi
si au moins une valeur est saisie.
public static java.sql.Timestamp getHour(java.lang.String strHour)
strHour
- Date à transformer
public static java.util.Date mergeDateHour(java.util.Date date, java.util.Date hour)
date
- datehour
- hour to set to the date
public static java.util.Date getHourWithoutDate(java.util.Date hour)
hour
- hour to set to the date
public static java.sql.Timestamp getDateLastMinute(java.util.Date date)
date
- the date who must convert
public static java.sql.Timestamp getDateFirstMinute(java.util.Date date)
date
- the date who must convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |