net.fortuna.ical4j.model
Class DateTime

java.lang.Object
  extended byjava.util.Date
      extended bynet.fortuna.ical4j.model.Iso8601
          extended bynet.fortuna.ical4j.model.Date
              extended bynet.fortuna.ical4j.model.DateTime
All Implemented Interfaces:
Cloneable, Comparable, Serializable

public class DateTime
extends Date

Represents a time of day on a specific date.

Author:
Ben Fortuna
See Also:
Serialized Form

Constructor Summary
DateTime()
          Default constructor.
DateTime(boolean utc)
           
DateTime(Date date)
           
DateTime(long time)
           
DateTime(String value)
          Constructs a new DateTime instance from parsing the specified string representation in the default (local) timezone.
DateTime(String value, TimeZone timezone)
           
 
Method Summary
 boolean equals(Object arg0)
           
 TimeZone getTimeZone()
          Returns the current timezone associated with this date-time value.
 int hashCode()
           
 boolean isUtc()
           
 void setTime(long time)
           
 void setTimeZone(TimeZone timezone)
          Sets the timezone associated with this date-time instance.
 void setUtc(boolean utc)
          Updates this date-time to display in UTC time if the argument is true.
 String toString()
           
 
Methods inherited from class net.fortuna.ical4j.model.Iso8601
getFormat
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateTime

public DateTime()
Default constructor.


DateTime

public DateTime(boolean utc)
Parameters:
utc -

DateTime

public DateTime(long time)
Parameters:
time -

DateTime

public DateTime(Date date)
Parameters:
date -

DateTime

public DateTime(String value)
         throws ParseException
Constructs a new DateTime instance from parsing the specified string representation in the default (local) timezone.

Parameters:
value -

DateTime

public DateTime(String value,
                TimeZone timezone)
         throws ParseException
Parameters:
value -
Throws:
ParseException
Method Detail

setTime

public final void setTime(long time)
Overrides:
setTime in class Iso8601

isUtc

public final boolean isUtc()
Returns:
Returns the utc.

setUtc

public final void setUtc(boolean utc)
Updates this date-time to display in UTC time if the argument is true. Otherwise, resets to the default timezone.

Parameters:
utc - The utc to set.

setTimeZone

public final void setTimeZone(TimeZone timezone)
Sets the timezone associated with this date-time instance. If the specified timezone is null

Parameters:
timezone -

getTimeZone

public final TimeZone getTimeZone()
Returns the current timezone associated with this date-time value.

Returns:
a Java timezone

toString

public final String toString()
Overrides:
toString in class Iso8601

equals

public boolean equals(Object arg0)

hashCode

public int hashCode()