Package fr.paris.lutece.util.date
Class DateUtil
java.lang.Object
fr.paris.lutece.util.date.DateUtil
This class provides date utils.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longconvertDaysInMiliseconds(long lDays) Get the number of milliseconds in a given number of daysstatic DateformatDate(String strDate, Locale locale) Get the date from String date The format pattern is specified internalystatic DateformatDateLongYear(String strDate, Locale locale) Get the date from String datestatic DateformatDateSql(String strDate, Locale locale) Get theDatefrom String date The format pattern is specified internalystatic TimestampformatTimestamp(String strDate, Locale locale) Get theTimestampfrom String date The format pattern is specified internalystatic StringgetCurrentDateString(Locale locale) Converts the current Date to a String datestatic DateFormatgetDateFormat(Locale locale) Get the Date format for the localestatic StringgetDateString(long lTime, Locale locale) Converts a long value to a String datestatic StringgetDateString(Timestamp date, Locale locale) Converts a Timestamp value to a String datestatic StringgetDateString(Date date, Locale locale) Convert the date to String with a standard patternstatic StringgetDefaultPattern(Locale locale) Return the pattern for datestatic StringgetIsoDateString(Date date) Get the ISO format ( yyyy-MM-dd HH:mm:ss ) of a datestatic DateparseIsoDate(String strDate) Parse a date from ISO format ( yyyy-MM-dd HH:mm:ss )
-
Field Details
-
ISO_PATTERN_DATE
- See Also:
-
-
Method Details
-
formatDate
Get the date from String date The format pattern is specified internaly- Parameters:
strDate- the date to formatlocale- The Locale- Returns:
- The Date or null else
-
formatDateLongYear
Get the date from String date- Parameters:
strDate- the date to formatlocale- The Locale- Returns:
- The Date or null else
-
formatTimestamp
Get theTimestampfrom String date The format pattern is specified internaly- Parameters:
strDate- the date to formatlocale- The Locale- Returns:
- The
Timestampor null else
-
formatDateSql
Get theDatefrom String date The format pattern is specified internaly- Parameters:
strDate- the date to formatlocale- The Locale- Returns:
- The
Dateor null else
-
getDateString
Convert the date to String with a standard pattern- Parameters:
date- The date to convertlocale- The Locale- Returns:
- The formated String
-
getDateString
Converts a long value to a String date- Parameters:
lTime- The long value to convertlocale- the locale- Returns:
- The formatted string
-
getDateString
Converts a Timestamp value to a String date- Parameters:
date- The datelocale- the locale- Returns:
- The formatted string
-
getCurrentDateString
Converts the current Date to a String date- Parameters:
locale- the locale- Returns:
- The formatted string
-
getDefaultPattern
Return the pattern for date- Parameters:
locale- the Locale- Returns:
- The pattern as a String
-
convertDaysInMiliseconds
public static long convertDaysInMiliseconds(long lDays) Get the number of milliseconds in a given number of days- Parameters:
lDays- The number of days- Returns:
- The number of milliseconds in the given number of days
-
getDateFormat
Get the Date format for the locale- Parameters:
locale-- Returns:
-
parseIsoDate
Parse a date from ISO format ( yyyy-MM-dd HH:mm:ss )- Parameters:
strDate-- Returns:
- parsed
Dateor null if the string can't be parsed - Since:
- 7.0.1
-
getIsoDateString
Get the ISO format ( yyyy-MM-dd HH:mm:ss ) of a date- Parameters:
date-- Returns:
- string of the date in iso format, or null if param is null
- Since:
- 7.0.1
-