com.openexchange.mail.utils
Class DateUtils

java.lang.Object
  extended by com.openexchange.mail.utils.DateUtils

public final class DateUtils
extends java.lang.Object

DateUtils - Provides some date-related utility constants/methods

Author:
Thorben Betten

Method Summary
static java.util.Date getDateRFC822(java.lang.String string)
          Gets the corresponding instance of Date from specified RFC822 date string
static java.lang.String toStringRFC822(java.util.Date d)
          Gets the corresponding RFC822 date string from specified instance of Date
static java.lang.String toStringRFC822(java.util.Date d, java.util.TimeZone tz)
          Gets the corresponding RFC822 date string from specified instance of Date
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDateRFC822

public static java.util.Date getDateRFC822(java.lang.String string)
Gets the corresponding instance of Date from specified RFC822 date string

Parameters:
string - The RFC822 date string
Returns:
The corresponding instance of Date
Throws:
java.lang.IllegalArgumentException - If specified string cannot be parsed to date

toStringRFC822

public static java.lang.String toStringRFC822(java.util.Date d)
Gets the corresponding RFC822 date string from specified instance of Date

Parameters:
d - The instance of Date to convert
Returns:
The corresponding RFC822 date string

toStringRFC822

public static java.lang.String toStringRFC822(java.util.Date d,
                                              java.util.TimeZone tz)
Gets the corresponding RFC822 date string from specified instance of Date

Parameters:
d - The instance of Date to convert
tz - The time zone
Returns:
The corresponding RFC822 date string