|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.james.util.RFC822Date
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()
Constructor Summary | |
RFC822Date()
creates a current timestamp using this machines system timezone |
|
RFC822Date(java.util.Date da)
creates object using date supplied and this machines system timezone |
|
RFC822Date(java.util.Date da,
java.lang.String useTZ)
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. |
|
RFC822Date(java.lang.String rfcdate)
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(java.lang.String rfcdate,
java.lang.String useTZ)
creates object from RFC822 date string supplied using the supplied time zone string |
Method Summary | |
java.util.Date |
getDate()
returns the java.util.Date object this RFC822Date represents. |
void |
setDate(java.util.Date da)
|
void |
setDate(java.lang.String rfcdate)
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(java.lang.String useTZ)
|
void |
setTimeZone(java.util.TimeZone useTZ)
|
java.lang.String |
toString()
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 |
public RFC822Date()
public RFC822Date(java.util.Date da)
da
- java.util.Date, A date objectpublic RFC822Date(java.util.Date da, java.lang.String useTZ)
da
- java.util.Date, a date objectuseTZ
- java.lang.Sting, a timezone string such as "America/Los_Angeles" or "GMT+02:00"public RFC822Date(java.lang.String rfcdate)
rfcdate
- java.lang.String - date in RFC822 format "3 Oct 2001 08:32:44 -0000"public RFC822Date(java.lang.String rfcdate, java.lang.String useTZ)
rfcdate
- java.lang.String - date in RFC822 formatuseTZ
- java.lang.String - timezone string *doesn't support Z style or UT*Method Detail |
public void setDate(java.util.Date da)
public void setDate(java.lang.String rfcdate)
rfcdate
- java.lang.String - date in RFC822 formatpublic void setTimeZone(java.util.TimeZone useTZ)
public void setTimeZone(java.lang.String useTZ)
public java.util.Date getDate()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |