org.apache.james.util
Class RFC822Date

java.lang.Object
  |
  +--org.apache.james.util.RFC822Date

Deprecated. Use java.util.Date in combination with org.apache.james.util.RFC822DateFormat.

public class RFC822Date
extends Object

A utility class to allow creation of RFC822 date strings from Dates and dates from RFC822 strings
It provides for conversion between timezones, And easy manipulation of RFC822 dates
example - current timestamp: String nowdate = new RFC822Date().toString()
example - convert into java.util.Date: Date usedate = new RFC822Date("3 Oct 2001 08:32:44 -0000").getDate()
example - convert to timezone: String yourdate = new RFC822Date("3 Oct 2001 08:32:44 -0000", "GMT+02:00").toString()
example - convert to local timezone: String mydate = new RFC822Date("3 Oct 2001 08:32:44 -0000").toString()

Author:
Danny Angus (danny)
, Peter M. Goldstein

Constructor Summary
RFC822Date()
          Deprecated. creates a current timestamp using this machines system timezone
RFC822Date(Date da)
          Deprecated. creates object using date supplied and this machines system timezone
RFC822Date(Date da, String useTZ)
          Deprecated. creates object using date supplied and the timezone string supplied
useTZ can be either an abbreviation such as "PST", a full name such as "America/Los_Angeles",
or a custom ID such as "GMT-8:00".
RFC822Date(String rfcdate)
          Deprecated. creates object from RFC822 date string supplied and the system default time zone
In practice it converts RFC822 date string to the local timezone
RFC822Date(String rfcdate, String useTZ)
          Deprecated. creates object from RFC822 date string supplied using the supplied time zone string
 
Method Summary
 Date getDate()
          Deprecated. returns the java.util.Date object this RFC822Date represents.
 void setDate(Date da)
          Deprecated.  
 void setDate(String rfcdate)
          Deprecated. The following styles of rfc date strings can be parsed
Wed, 3 Oct 2001 06:42:27 GMT+02:10
Wed 3 Oct 2001 06:42:27 PST
3 October 2001 06:42:27 +0100
the military style timezones, ZM, ZA, etc cannot (yet)
 void setTimeZone(String useTZ)
          Deprecated.  
 void setTimeZone(TimeZone useTZ)
          Deprecated.  
 String toString()
          Deprecated. returns the date as a string formated for RFC822 compliance ,accounting for timezone and daylight saving.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RFC822Date

public RFC822Date()
Deprecated. 
creates a current timestamp using this machines system timezone


RFC822Date

public RFC822Date(Date da)
Deprecated. 
creates object using date supplied and this machines system timezone

Parameters:
da - java.util.Date, A date object

RFC822Date

public RFC822Date(Date da,
                  String useTZ)
Deprecated. 
creates object using date supplied and the timezone string supplied
useTZ can be either an abbreviation such as "PST", a full name such as "America/Los_Angeles",
or a custom ID such as "GMT-8:00".
Note that this is dependant on java.util.TimeZone
Note that the support of abbreviations is for JDK 1.1.x compatibility only and full names should be used.

Parameters:
da - java.util.Date, a date object
useTZ - java.lang.Sting, a timezone string such as "America/Los_Angeles" or "GMT+02:00"

RFC822Date

public RFC822Date(String rfcdate)
Deprecated. 
creates object from RFC822 date string supplied and the system default time zone
In practice it converts RFC822 date string to the local timezone

Parameters:
rfcdate - java.lang.String - date in RFC822 format "3 Oct 2001 08:32:44 -0000"

RFC822Date

public RFC822Date(String rfcdate,
                  String useTZ)
Deprecated. 
creates object from RFC822 date string supplied using the supplied time zone string

Parameters:
rfcdate - java.lang.String - date in RFC822 format
useTZ - java.lang.String - timezone string *doesn't support Z style or UT*
Method Detail

setDate

public void setDate(Date da)
Deprecated. 

setDate

public void setDate(String rfcdate)
Deprecated. 
The following styles of rfc date strings can be parsed
Wed, 3 Oct 2001 06:42:27 GMT+02:10
Wed 3 Oct 2001 06:42:27 PST
3 October 2001 06:42:27 +0100
the military style timezones, ZM, ZA, etc cannot (yet)

Parameters:
rfcdate - java.lang.String - date in RFC822 format

setTimeZone

public void setTimeZone(TimeZone useTZ)
Deprecated. 

setTimeZone

public void setTimeZone(String useTZ)
Deprecated. 

getDate

public Date getDate()
Deprecated. 
returns the java.util.Date object this RFC822Date represents.

Returns:
java.util.Date - the java.util.Date object this RFC822Date represents.

toString

public String toString()
Deprecated. 
returns the date as a string formated for RFC822 compliance ,accounting for timezone and daylight saving.

Overrides:
toString in class Object
Returns:
java.lang.String - date as a string formated for RFC822 compliance


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."