Package org.faktorips.runtime.internal
Class DateTime
java.lang.Object
org.faktorips.runtime.internal.DateTime
- All Implemented Interfaces:
Serializable
,Comparable<DateTime>
Represents date and time information like 2006-01-01 10:00pm independent of the time zone. To
convert a date and time object to a point in time (represented in the Java class libraries by
Date and Calendar) a time zone has to be provided in the conversion method toDate().
- Author:
- Jan Ortmann
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
static final DateTime
createDateOnly
(GregorianCalendar calendar) Creates a new date time object with the year, month and day information from the GregorianCalendar.boolean
int
getDay()
int
getHour()
int
int
getMonth()
int
int
getYear()
int
hashCode()
static final DateTime
Parses the given String s to a DateTime object.toGregorianCalendar
(TimeZone zone) toString()
long
toTimeInMillisecs
(TimeZone zone)
-
Constructor Details
-
DateTime
public DateTime(int year, int month, int day) -
DateTime
public DateTime(int year, int month, int day, int hour, int minute, int second)
-
-
Method Details
-
parseIso
Parses the given String s to a DateTime object. The string should have the ISO date format (YYYY-MM-DD). Time information is initialized with 0. Returnsnull
if s isnull
or an empty String.- Throws:
IllegalArgumentException
- if s has a wrong format and can't be parsed.
-
createDateOnly
Creates a new date time object with the year, month and day information from the GregorianCalendar. Time information is initialized with 0. Returnsnull
if calendar isnull
. -
getDay
public int getDay() -
getMonth
public int getMonth() -
getYear
public int getYear() -
getHour
public int getHour() -
getMinute
public int getMinute() -
getSecond
public int getSecond() -
toTimeInMillisecs
-
toDate
-
toGregorianCalendar
-
toIsoFormat
-
hashCode
public int hashCode() -
equals
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<DateTime>
-