de.uplanet.util
Class DateParser

java.lang.Object
  extended by de.uplanet.util.DateParser

@Scriptable
public final class DateParser
extends java.lang.Object

Version:
$Revision: 78825 $

Field Summary
static java.lang.String UTC_ISO_DATE_TIME_FORMAT
          yyyy-MM-dd'T'HH:mm:ss'Z'.
 
Method Summary
static java.util.Date parseDate(java.lang.String p_strValue)
          Parse a string as an UTC date, or as a date with time zone offset.
static java.util.Date parseDate(java.lang.String p_strValue, java.lang.String p_strFormat, java.util.TimeZone p_tz)
          Parse a string as a date, using the given format, time zone, and the Locale.US locale.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTC_ISO_DATE_TIME_FORMAT

public static final java.lang.String UTC_ISO_DATE_TIME_FORMAT
yyyy-MM-dd'T'HH:mm:ss'Z'.

See Also:
Constant Field Values
Method Detail

parseDate

public static final java.util.Date parseDate(java.lang.String p_strValue,
                                             java.lang.String p_strFormat,
                                             java.util.TimeZone p_tz)
Parse a string as a date, using the given format, time zone, and the Locale.US locale.

Parameters:
p_strValue - The serialized date-time value.
p_strFormat - The format used for parsing.
p_tz - The timezone to be used for parsing.
Returns:
The parsed date.
Throws:
java.lang.IllegalArgumentException - If any of the given parameters is null.

parseDate

public static final java.util.Date parseDate(java.lang.String p_strValue)
                                      throws java.text.ParseException
Parse a string as an UTC date, or as a date with time zone offset.

Valid formats are

See SimpleDateFormat.

Parameters:
p_strValue - The serialized date-time value.
Returns:
The parsed date.
Throws:
java.text.ParseException - If the given string could not be parsed as a date-time value.
java.lang.IllegalArgumentException - If p_strValue is null.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.