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 TypeMethodDescriptionintstatic final DateTimecreateDateOnly(GregorianCalendar calendar) Creates a new date time object with the year, month and day information from the GregorianCalendar.booleanintgetDay()intgetHour()intintgetMonth()intintgetYear()inthashCode()static final DateTimeParses the given String s to a DateTime object.toGregorianCalendar(TimeZone zone) toString()longtoTimeInMillisecs(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. Returnsnullif s isnullor 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. Returnsnullif 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:
compareToin interfaceComparable<DateTime>
-