public final class DateUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DATE_CRITERE_ENTRE_LE |
static int |
DATE_CRITERE_ET_LE |
static int |
DATE_CRITERE_OU_LE |
static String |
DATE_FR |
static String |
HOUR_FR |
static String |
XML_DATE_FORMAT |
Modifier and Type | Method and Description |
---|---|
static String |
converteDateAnglais(String dateAnglaise)
Convertis une date depuis le format dd/MM/yyyy vers le format dd-MM-yyyy.
|
static String |
getAnnee(Date date)
Retourne l'année d'une date
|
static int |
getAnneeEnCours()
Retourne l'année en cours
|
static Timestamp |
getCurrentDate()
Retourne la date du jour
|
static String |
getCurrentDateString()
renvoie la date courante.
|
static String |
getCurrentDateString(String strPattern)
renvoie la date courante
|
static String |
getDate(Date date,
String strPattern)
Renvoie la date sous le format défini par strPattern
|
static Timestamp |
getDate(String strDate,
boolean isStartOfDayHour)
Transfome une date en format string de type dd/MM/yyyy en objet Timestamp
|
static Timestamp |
getDate(Timestamp date,
boolean isStartOfDayHour)
Renvoie un timestamp dont l'heure doit etre 00h01 FALSE si l'heure doit
etre 23H59
|
static String |
getDate(Timestamp date,
String strPattern)
Renvoie la date sous le format défini par strPattern
|
static Timestamp |
getDateFirstMinute(Date date)
return a timestamp Object which correspond with the string specified in
parameter.
|
static String |
getDateFr(Date date)
Return string for date dd/MM/yyyy
|
static Timestamp |
getDateLastMinute(Date date)
return a timestamp Object which correspond with the string specified in
parameter.
|
static Timestamp |
getHour(String strHour)
Transfome une date en format string de type HH:mm en objet Timestamp
|
static String |
getHourFr(Date date)
Return string for date HH:mm
|
static Date |
getHourWithoutDate(Date hour)
Get a timestamp with hour setted and date 01/01/1970.
|
static Date |
mergeDateHour(Date date,
Date hour)
Set the given date hour with the given hour.
|
static boolean |
validateDate(String date)
Validate a date
|
static boolean |
valideDateEntreLeEtLeOuLe(List<String> dateEffetRecherche,
boolean obligatoire)
vérifie un trigramme de dates entre le ...
|
static boolean |
verifierHeure(String sHeure)
Vérifie que l'heure est bien au format HH:mm.
|
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 String XML_DATE_FORMAT
public static final String DATE_FR
public static final String HOUR_FR
public static Timestamp getDate(String strDate, boolean isStartOfDayHour)
strDate
- Date à transformerisStartOfDayHour
- TRUE si l'heure doit etre 00h01 FALSE si l'heure
doit etre 23H59public static String getDate(Timestamp date, String strPattern)
date
- la datestrPattern
- le format souhaite de la datepublic static String getDate(Date date, String strPattern)
date
- la datestrPattern
- le format souhaite de la datepublic static String getDateFr(Date date)
date
- the datepublic static String getHourFr(Date date)
date
- the datepublic static Timestamp getCurrentDate()
public static String getCurrentDateString(String strPattern)
strPattern
- Le format de la date courantepublic static String getCurrentDateString()
public static Timestamp getDate(Timestamp date, boolean isStartOfDayHour)
date
- Date à transformerisStartOfDayHour
- true si l'heure doit etre 00h01 FALSE si l'heure
doit etre 23H59public static int getAnneeEnCours()
public static String converteDateAnglais(String dateAnglaise) throws ParseException
dateAnglaise
- date au format dd/MM/yyyyParseException
- lancé si la date en entrée n'est pas valide.public static boolean verifierHeure(String sHeure)
sHeure
- string heurepublic static String getAnnee(Date date)
date
- datepublic static boolean validateDate(String date)
date
- la datepublic static boolean valideDateEntreLeEtLeOuLe(List<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 Timestamp getHour(String strHour)
strHour
- Date à transformerpublic static Date mergeDateHour(Date date, Date hour)
date
- datehour
- hour to set to the datepublic static Date getHourWithoutDate(Date hour)
hour
- hour to set to the datepublic static Timestamp getDateLastMinute(Date date)
date
- the date who must convertCopyright © 2019 City of Paris. All rights reserved.