org.eclipse.webdav.internal.kernel.utils
Class DateTime

java.lang.Object
  extended by org.eclipse.webdav.internal.kernel.utils.DateTime

public class DateTime
extends Object

A generic date and time object. It uses UTC as the timezone and US as the locale.


Field Summary
protected static String ASCTIME_PATTERN
           
protected  SimpleDateFormat dateFormat
           
protected  long dateTime
           
protected static String ISO_8601_MILLIS_PATTERN
           
protected static String ISO_8601_PATTERN
           
protected static String ISO_8601_UTC_MILLIS_PATTERN
           
protected static String ISO_8601_UTC_PATTERN
           
protected static String RFC_1123_PATTERN
           
protected static String RFC_850_PATTERN
           
 
Constructor Summary
DateTime()
           
DateTime(long date)
          Starts this object from a java long format (milliseconds).
 
Method Summary
 boolean after(DateTime other)
           
 boolean before(DateTime other)
           
 boolean equals(DateTime other)
           
 long getDateTime()
          Milliseconds since 1 January 1970 0:00 UTC.
 int getMilliseconds()
           
 void setDateTime(Date date)
           
 void setDateTime(long dateTime)
          Sets the date and time from a java long format (milliseconds).
 void setDateTime(String date)
          Do nothing if date format is not supported
protected  boolean setDateTime(String date, String pattern)
          Do nothing if date format is not supported.
 Date toDate()
           
 String toISO8601()
           
 String toRFC1123()
           
 String toString()
          Returns on a RFC 1123 format.
protected  String toString(String pattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dateFormat

protected SimpleDateFormat dateFormat

dateTime

protected long dateTime

RFC_1123_PATTERN

protected static final String RFC_1123_PATTERN
See Also:
Constant Field Values

RFC_850_PATTERN

protected static final String RFC_850_PATTERN
See Also:
Constant Field Values

ASCTIME_PATTERN

protected static final String ASCTIME_PATTERN
See Also:
Constant Field Values

ISO_8601_UTC_PATTERN

protected static final String ISO_8601_UTC_PATTERN
See Also:
Constant Field Values

ISO_8601_PATTERN

protected static final String ISO_8601_PATTERN
See Also:
Constant Field Values

ISO_8601_UTC_MILLIS_PATTERN

protected static final String ISO_8601_UTC_MILLIS_PATTERN
See Also:
Constant Field Values

ISO_8601_MILLIS_PATTERN

protected static final String ISO_8601_MILLIS_PATTERN
See Also:
Constant Field Values
Constructor Detail

DateTime

public DateTime()

DateTime

public DateTime(long date)
Starts this object from a java long format (milliseconds).

Method Detail

after

public boolean after(DateTime other)

before

public boolean before(DateTime other)

equals

public boolean equals(DateTime other)

getDateTime

public long getDateTime()
Milliseconds since 1 January 1970 0:00 UTC.


getMilliseconds

public int getMilliseconds()

setDateTime

public void setDateTime(long dateTime)
Sets the date and time from a java long format (milliseconds).


setDateTime

public void setDateTime(String date)
Do nothing if date format is not supported


setDateTime

protected boolean setDateTime(String date,
                              String pattern)
Do nothing if date format is not supported.


setDateTime

public void setDateTime(Date date)

toDate

public Date toDate()

toISO8601

public String toISO8601()

toRFC1123

public String toRFC1123()

toString

public String toString()
Returns on a RFC 1123 format.

Overrides:
toString in class Object

toString

protected String toString(String pattern)


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.