org.lsc.utils
Class DateUtils

java.lang.Object
  extended by org.lsc.utils.DateUtils

public final class DateUtils
extends Object

Manage LDAP date format.

For example, use :


Field Summary
static String LDAP_DATE_INTERNAL_STORAGE_FORMAT
          This is the standard LDAP date format : yyyyMMddHHmmss.S'Z'.
static String LDAP_DATE_SIMPLIFIED_STORAGE_FORMAT
          This is the simplified LDAP date format : yyyyMMddHHmmss'Z'.
 
Constructor Summary
DateUtils()
           
 
Method Summary
static String format(Date date)
          Generate a date string - synchronized call to internal formatter object to support multi-threaded calls.
static Date parse(String date)
          Return a date object corresponding to the LDAP date string.
static String simpleFormat(Date date)
          Generate a date string - synchronized call to internal formatter object to support multi-threaded calls.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LDAP_DATE_INTERNAL_STORAGE_FORMAT

public static final String LDAP_DATE_INTERNAL_STORAGE_FORMAT
This is the standard LDAP date format : yyyyMMddHHmmss.S'Z'.

See Also:
Constant Field Values

LDAP_DATE_SIMPLIFIED_STORAGE_FORMAT

public static final String LDAP_DATE_SIMPLIFIED_STORAGE_FORMAT
This is the simplified LDAP date format : yyyyMMddHHmmss'Z'.

See Also:
Constant Field Values
Constructor Detail

DateUtils

public DateUtils()
Method Detail

parse

public static Date parse(String date)
                  throws ParseException
Return a date object corresponding to the LDAP date string.

Parameters:
date - the date to parse
Returns:
the corresponding Java Date object
Throws:
ParseException - thrown if an error occurs in date parsing

format

public static String format(Date date)
Generate a date string - synchronized call to internal formatter object to support multi-threaded calls.

Parameters:
date - date to extract
Returns:
generated date

simpleFormat

public static String simpleFormat(Date date)
Generate a date string - synchronized call to internal formatter object to support multi-threaded calls. This uses the simplified format: yyyyMMddHHmmss'Z'

Parameters:
date - date to extract
Returns:
generated date


Copyright © 2005-2010 LSC project. All Rights Reserved.