fr.paris.lutece.util.date
Class DateUtil

java.lang.Object
  extended by fr.paris.lutece.util.date.DateUtil

public final class DateUtil
extends Object

This class provides date utils.


Method Summary
static long convertDaysInMiliseconds(long lDays)
          Get the number of milliseconds in a given number of days
static Date formatDate(String strDate, Locale locale)
          Get the date from String date The format pattern is specified internaly
static Date formatDateLongYear(String strDate, Locale locale)
          Get the date from String date
static Date formatDateSql(String strDate, Locale locale)
          Get the Date from String date The format pattern is specified internaly
static Timestamp formatTimestamp(String strDate, Locale locale)
          Get the Timestamp from String date The format pattern is specified internaly
static String getCurrentDateString()
          Deprecated. Use getCurrentDateString( Locale locale )
static String getCurrentDateString(Locale locale)
          Converts the current Date to a String date
static Date getDate(String strDate)
          Deprecated. Use formatDate( String strDate, Locale locale )
static Date getDateSql(String strDate)
          Deprecated. Use formatDateSql( String strDate, Locale locale )
static String getDateString(Date date)
          Deprecated. Use getDateString( Date date, Locale locale )
static String getDateString(Date date)
          Deprecated. Use formatDate( String strDate, Locale locale )
static String getDateString(Date date, Locale locale)
          Convert the date to String with a standard pattern
static String getDateString(long lTime, Locale locale)
          Converts a long value to a String date
static String getDateString(Timestamp date)
          Deprecated. Use getDateString( java.sql.Timestamp date, Locale locale )
static String getDateString(Timestamp date, Locale locale)
          Converts a Timestamp value to a String date
static String getDateTimeString(long lTime)
          Converts a long value to a String date in a "jj/mm/aaaa hh:mm" format
static String getDefaultPattern(Locale locale)
          Return the pattern for date
static Timestamp getTimestamp(String strDate)
          Deprecated. Use formatTimestamp( String strDate, Locale locale )
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentDateString

public static String getCurrentDateString()
Deprecated. Use getCurrentDateString( Locale locale )

Returns the date of the day in form of a String

Returns:
The Date of the day in a "JJ/MM/AAAA" format

getDateSql

public static Date getDateSql(String strDate)
Deprecated. Use formatDateSql( String strDate, Locale locale )

Converts a String date in a "jj/mm/aaaa" format in a java.sql.Date type date

Parameters:
strDate - The String Date to convert, in a date in the "jj/mm/aaaa" format
Returns:
The date in form of a java.sql.Date type date

getDate

public static Date getDate(String strDate)
Deprecated. Use formatDate( String strDate, Locale locale )

Converts a String date in a "jj/mm/aaaa" format in a java.util.Date type date

Parameters:
strDate - The String Date to convert, in a date in the "jj/mm/aaaa" format
Returns:
The date in form of a java.sql.Date tyep date

getTimestamp

public static Timestamp getTimestamp(String strDate)
Deprecated. Use formatTimestamp( String strDate, Locale locale )

Converts a String date in a "jj/mm/aaaa" format in a java.sql.Timestamp type date

Parameters:
strDate - The String Date to convert, in a date in the "jj/mm/aaaa" format
Returns:
The date in form of a java.sql.Date tyep date

getDateString

public static String getDateString(Date date)
Deprecated. Use getDateString( Date date, Locale locale )

Converts a java.sql.Date type date in a String date with a "jj/mm/aaaa" format

Parameters:
date - java.sql.Date date to convert
Returns:
strDate The date converted to String in a "jj/mm/aaaa" format or an empty String if the date is null

getDateString

public static String getDateString(Timestamp date)
Deprecated. Use getDateString( java.sql.Timestamp date, Locale locale )

Converts une java.sql.Timestamp date in a String date in a "jj/mm/aaaa" format

Parameters:
date - java.sql.Timestamp date to convert
Returns:
strDate The String date in a "jj/mm/aaaa" format or the emmpty String if the date is null

getDateString

public static String getDateString(Date date)
Deprecated. Use formatDate( String strDate, Locale locale )

Converts a java.util.Date date in a String date in a "jj/mm/aaaa" format

Parameters:
date - java.util.Date date to convert
Returns:
strDate A String date in a "jj/mm/aaaa" format or an empty String if the date is null

getDateTimeString

public static String getDateTimeString(long lTime)
Converts a long value to a String date in a "jj/mm/aaaa hh:mm" format

Parameters:
lTime - The long value to convert
Returns:
The formatted string

formatDate

public static Date formatDate(String strDate,
                              Locale locale)
Get the date from String date The format pattern is specified internaly

Parameters:
strDate - the date to format
locale - The Locale
Returns:
The Date or null else

formatDateLongYear

public static Date formatDateLongYear(String strDate,
                                      Locale locale)
Get the date from String date

Parameters:
strDate - the date to format
locale - The Locale
Returns:
The Date or null else

formatTimestamp

public static Timestamp formatTimestamp(String strDate,
                                        Locale locale)
Get the Timestamp from String date The format pattern is specified internaly

Parameters:
strDate - the date to format
locale - The Locale
Returns:
The Timestamp or null else

formatDateSql

public static Date formatDateSql(String strDate,
                                 Locale locale)
Get the Date from String date The format pattern is specified internaly

Parameters:
strDate - the date to format
locale - The Locale
Returns:
The Date or null else

getDateString

public static String getDateString(Date date,
                                   Locale locale)
Convert the date to String with a standard pattern

Parameters:
date - The date to convert
locale - The Locale
Returns:
The formated String

getDateString

public static String getDateString(long lTime,
                                   Locale locale)
Converts a long value to a String date

Parameters:
lTime - The long value to convert
locale - the locale
Returns:
The formatted string

getDateString

public static String getDateString(Timestamp date,
                                   Locale locale)
Converts a Timestamp value to a String date

Parameters:
date - The date
locale - the locale
Returns:
The formatted string

getCurrentDateString

public static String getCurrentDateString(Locale locale)
Converts the current Date to a String date

Parameters:
locale - the locale
Returns:
The formatted string

getDefaultPattern

public static String getDefaultPattern(Locale locale)
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


Copyright © 2014 Mairie de Paris. All Rights Reserved.