fr.paris.lutece.util.date
Class DateUtil

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

public final class DateUtil
extends java.lang.Object

This class provides date utils.


Method Summary
static java.util.Date formatDate(java.lang.String strDate, java.util.Locale locale)
          Get the date from String date The format pattern is specified internaly
static java.util.Date formatDateLongYear(java.lang.String strDate, java.util.Locale locale)
          Get the date from String date
static java.sql.Date formatDateSql(java.lang.String strDate, java.util.Locale locale)
          Get the Date from String date The format pattern is specified internaly
static java.sql.Timestamp formatTimestamp(java.lang.String strDate, java.util.Locale locale)
          Get the Timestamp from String date The format pattern is specified internaly
static java.lang.String getCurrentDateString()
          Deprecated. Use getCurrentDateString( Locale locale )
static java.lang.String getCurrentDateString(java.util.Locale locale)
          Converts the current Date to a String date
static java.util.Date getDate(java.lang.String strDate)
          Deprecated. Use formatDate( String strDate, Locale locale )
static java.sql.Date getDateSql(java.lang.String strDate)
          Deprecated. Use formatDateSql( String strDate, Locale locale )
static java.lang.String getDateString(java.sql.Date date)
          Deprecated. Use getDateString( Date date, Locale locale )
static java.lang.String getDateString(java.util.Date date)
          Deprecated. Use formatDate( String strDate, Locale locale )
static java.lang.String getDateString(java.util.Date date, java.util.Locale locale)
          Convert the date to String with a standard pattern
static java.lang.String getDateString(long lTime, java.util.Locale locale)
          Converts a long value to a String date
static java.lang.String getDateString(java.sql.Timestamp date)
          Deprecated. Use getDateString( java.sql.Timestamp date, Locale locale )
static java.lang.String getDateString(java.sql.Timestamp date, java.util.Locale locale)
          Converts a Timestamp value to a String date
static java.lang.String getDateTimeString(long lTime)
          Converts a long value to a String date in a "jj/mm/aaaa hh:mm" format
static java.lang.String getDefaultPattern(java.util.Locale locale)
          Return the pattern for date
static java.sql.Timestamp getTimestamp(java.lang.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 java.lang.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 java.sql.Date getDateSql(java.lang.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 java.util.Date getDate(java.lang.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 java.sql.Timestamp getTimestamp(java.lang.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 java.lang.String getDateString(java.sql.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 java.lang.String getDateString(java.sql.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 java.lang.String getDateString(java.util.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 java.lang.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 java.util.Date formatDate(java.lang.String strDate,
                                        java.util.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 java.util.Date formatDateLongYear(java.lang.String strDate,
                                                java.util.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 java.sql.Timestamp formatTimestamp(java.lang.String strDate,
                                                 java.util.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 java.sql.Date formatDateSql(java.lang.String strDate,
                                          java.util.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 java.lang.String getDateString(java.util.Date date,
                                             java.util.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 java.lang.String getDateString(long lTime,
                                             java.util.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 java.lang.String getDateString(java.sql.Timestamp date,
                                             java.util.Locale locale)
Converts a Timestamp value to a String date

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

getCurrentDateString

public static java.lang.String getCurrentDateString(java.util.Locale locale)
Converts the current Date to a String date

Parameters:
locale - the locale
Returns:
The formatted string

getDefaultPattern

public static java.lang.String getDefaultPattern(java.util.Locale locale)
Return the pattern for date

Parameters:
locale - the Locale
Returns:
The pattern as a String


Copyright © 2010 Mairie de Paris. All Rights Reserved.