|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.prosyst.util.text.DateFormat
public class DateFormat
Class utilizing the work with specific date format, often defined in rfc-s. The class supports construction of RFC1123 date and parsing of RFC1036, RFC1123, and ANSI C's asctime() formats. Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123 Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036 Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
| Field Summary | |
|---|---|
protected static java.util.Calendar |
calendar
|
protected static java.util.Date |
date
|
protected static java.lang.String[] |
MONTH_NAMES
|
protected static java.lang.String[] |
WEEK_DAYS
|
protected static java.util.TimeZone |
zone
|
| Constructor Summary | |
|---|---|
DateFormat()
|
|
| Method Summary | |
|---|---|
protected static void |
appendInt(java.lang.StringBuffer stringbuffer,
int i)
Appends the int to the string buffer, without creation of char[] and string objects. |
static java.lang.String |
format()
Constructs a new date with time zone "GMT", US locale and date - current date. |
static java.lang.String |
format(long l)
Constructs a new date with time zone "GMT", US locale and date defined by l milliseconds. |
static java.lang.String |
format(long l,
java.lang.StringBuffer sb)
Constructs a new date with time zone "GMT", US locale and date defined by l milliseconds. |
protected static void |
formatDoubleDigit(java.lang.StringBuffer stringbuffer,
int i)
Appends to the string buffer the number passed, formatting it as a two digit string. |
protected static int |
locateMonth(java.lang.String s)
Gets the index from MONTH_NAMES array of the month string passed, i.e if "Jan" is passed, the method will retrive 0. |
static long |
parse(java.lang.String s)
Test if the string conforms with any of supported date formats and returns the date value (in milliseconds since 1 January, 1970) that matches the string. |
static long |
parseASC(java.lang.String s)
Parses a string, formatted in ANSI C's asctime. |
static long |
parseRFC1036(java.lang.String s)
Parses a string, formatted according to RFC1036 date. |
static long |
parseRFC1123(java.lang.String s)
Parses a string, formatted according to RFC1123 date. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.TimeZone zone
protected static final java.lang.String[] MONTH_NAMES
protected static final java.lang.String[] WEEK_DAYS
protected static java.util.Calendar calendar
protected static java.util.Date date
| Constructor Detail |
|---|
public DateFormat()
| Method Detail |
|---|
public static java.lang.String format()
public static java.lang.String format(long l)
l - milliseconds to create a date with
public static java.lang.String format(long l,
java.lang.StringBuffer sb)
l - milliseconds to create a date withsb - the string buffer, where to append the formatted date, can be null
public static long parse(java.lang.String s)
throws java.lang.IllegalArgumentException
s - string to parse.
java.lang.IllegalArgumentException - if the string format does
not match any of the supported standards
public static long parseASC(java.lang.String s)
throws java.lang.IllegalArgumentException
s - date to parse; must be in ANSI C's asctime format.
e.g.: Sun Nov 6 08:49:37 1994
java.lang.IllegalArgumentException - if incorrectly formatted
public static long parseRFC1036(java.lang.String s)
throws java.lang.IllegalArgumentException
s - date to parse; must be in RFC1036 format.
e.g.: Sunday, 06-Nov-94 08:49:37 GMT
java.lang.IllegalArgumentException - if incorrectly formatted
public static long parseRFC1123(java.lang.String s)
throws java.lang.IllegalArgumentException
s - date to parse; must be in RFC1123 format.
e.g.: Sun, 06 Nov 1994 08:49:37 GMT
java.lang.IllegalArgumentException - if incorrectly formatted
protected static int locateMonth(java.lang.String s)
throws java.lang.NumberFormatException
s - a three letter US.Locale month name.
java.lang.NumberFormatException - When moth string is invalid three letter name.
protected static void formatDoubleDigit(java.lang.StringBuffer stringbuffer,
int i)
stringbuffer - to append number i toi - to be formatted as two digits.
protected static void appendInt(java.lang.StringBuffer stringbuffer,
int i)
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||