com.ibm.wbi.http
Class HttpDate

java.lang.Object
  |
  +--com.ibm.wbi.http.HttpDate

public class HttpDate
extends java.lang.Object

HttpDate provides several services with regards to dates and date formatting.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright information.
static long DATE_ERROR
          Data error.
static long DATE_INFINITY
          Infinity constant.
static long DATE_NEVER
          Never constant.
static java.lang.String RFC1036DATEFMT
          RFC 1036 data format.
static java.lang.String RFC1123DATEFMT
          RFC 1123 date format.
static java.lang.String RFCASCTIMEFMT
          RFC ASC time format.
 
Constructor Summary
HttpDate()
          Constructs an HTTPDate object representing the current time.
HttpDate(long iTime)
          Constructs an HTTPDate object from the passed long.
HttpDate(java.lang.String iString)
          Constructs an HTTPDate object from an RFC compliant string.
 
Method Summary
 long getAsLong()
          Returns the time represented as a long.
 java.lang.String getAsString()
          Returns the time represented as a string.
 int getDay()
          Returns the day of the month of the internal time.
 int getHour()
          Returns the hour of the day of the internal time.
 int getMin()
          Returns the minute of the hour of the internal time.
 int getMonth()
          Returns the month of the year of the internal time.
 int getSec()
          Returns the second of the minute of the internal time.
 int getWDay()
          Returns the day of the week of the internal time.
 int getYear()
          Returns the year of the internal time.
 java.lang.String toString()
          Returns the internal time represented as a string in RFC 1123 format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright information.

DATE_NEVER

public static final long DATE_NEVER
Never constant.

DATE_INFINITY

public static final long DATE_INFINITY
Infinity constant.

DATE_ERROR

public static final long DATE_ERROR
Data error.

RFC1123DATEFMT

public static final java.lang.String RFC1123DATEFMT
RFC 1123 date format.

RFC1036DATEFMT

public static final java.lang.String RFC1036DATEFMT
RFC 1036 data format.

RFCASCTIMEFMT

public static final java.lang.String RFCASCTIMEFMT
RFC ASC time format.
Constructor Detail

HttpDate

public HttpDate(java.lang.String iString)
Constructs an HTTPDate object from an RFC compliant string. RFC2068 3.3.1 compliant
Parameters:
iString - The time in a formatted string.

HttpDate

public HttpDate()
Constructs an HTTPDate object representing the current time.

HttpDate

public HttpDate(long iTime)
Constructs an HTTPDate object from the passed long.
Parameters:
iTime - The number of uSeconds since the epoch (in milli).
Method Detail

getDay

public int getDay()
Returns the day of the month of the internal time.
Returns:
The day of the month.

getWDay

public int getWDay()
Returns the day of the week of the internal time. The number is in the range of 0 to 6 where 0 represents Sunday.
Returns:
The day of the week.

getMonth

public int getMonth()
Returns the month of the year of the internal time. The number is in the range of 0 to 11 where 0 represents January.
Returns:
The month of the year.

getYear

public int getYear()
Returns the year of the internal time.
Parameters:
The - year.

getHour

public int getHour()
Returns the hour of the day of the internal time.
Returns:
The hour.

getMin

public int getMin()
Returns the minute of the hour of the internal time.
Parameters:
The - minute.

getSec

public int getSec()
Returns the second of the minute of the internal time.
Parameters:
The - second.

getAsLong

public long getAsLong()
Returns the time represented as a long. This represents the number of uSeconds since the epoch.
Returns:
The time represented as a long.

getAsString

public java.lang.String getAsString()
Returns the time represented as a string.
Returns:
The time represented as a string.

toString

public java.lang.String toString()
Returns the internal time represented as a string in RFC 1123 format. return The time represented as a string.
Overrides:
toString in class java.lang.Object