net.fortuna.ical4j.model

Class DateTime


public class DateTime
extends Date

$Id: DateTime.java,v 1.26 2008/12/16 12:34:52 fortuna Exp $ Created on 26/06/2005 Represents a time of day on a specific date.

Constructor Summary

DateTime()
Default constructor.
DateTime(String value)
Constructs a new DateTime instance from parsing the specified string representation in the default (local) timezone.
DateTime(String value, TimeZone timezone)
Creates a new date-time instance from the specified value in the given timezone.
DateTime(boolean utc)
DateTime(java.util.Date date)
DateTime(long time)

Method Summary

boolean
equals(Object arg0)
Uses EqualsBuilder to test equality.
TimeZone
getTimeZone()
Returns the current timezone associated with this date-time value.
int
hashCode()
Uses HashCodeBuilder to build 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()

Constructor Details

DateTime

public DateTime()
Default constructor.

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
Creates a new date-time instance from the specified value in the given timezone. If a timezone is not specified, the default timezone (as returned by java.util.TimeZone.getDefault()) is used.
Parameters:
value -

DateTime

public DateTime(boolean utc)
Parameters:
utc -

DateTime

public DateTime(java.util.Date date)
Parameters:
date -

DateTime

public DateTime(long time)
Parameters:
time -

Method Details

equals

public boolean equals(Object arg0)
Uses EqualsBuilder to test equality.

getTimeZone

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

hashCode

public int hashCode()
Uses HashCodeBuilder to build hashcode.

isUtc

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

setTime

public final void setTime(long time)

setTimeZone

public final void setTimeZone(TimeZone timezone)
Sets the timezone associated with this date-time instance. If the specified timezone is null, it will reset to the default timezone. If the date-time instance is utc, it will turn into either a floating (no timezone) date-time, or a date-time with a timezone.
Parameters:
timezone -

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.

toString

public final String toString()