Represents a date and/or time.
Similar functionality as java.util.Calendar (and uses GregorianCalendar
internally) but supports arithmetic.
Can be for XML Schema date/time types, specifically as used in XPath/Xquery..
DATE_MASK
public static final int DATE_MASK
DAY_MASK
public static final int DAY_MASK
GMT
public static TimeZone GMT
HOURS_MASK
public static final int HOURS_MASK
MINUTES_MASK
public static final int MINUTES_MASK
MONTH_MASK
public static final int MONTH_MASK
SECONDS_MASK
public static final int SECONDS_MASK
TIMEZONE_MASK
public static final int TIMEZONE_MASK
TIME_MASK
public static final int TIME_MASK
YEAR_MASK
public static final int YEAR_MASK
adjustTimezone
public DateTime adjustTimezone(int newOffset)
cast
public DateTime cast(int newComponents)
compare
public int compare(Object obj)
Return an integer for which of {# code this} or {#code obj} is larger.
Return 1 if this>obj
; 0 if this==obj
;
-1 if this;
-2 if this!=obj
otherwise (for example if either is NaN);
-3 if not comparable (incompatible types).
- compare in interface Quantity
compare
public static int compare(DateTime date1,
DateTime date2)
Return -1, 0, or 1, depending on which value is greater.
components
public int components()
daysInMonth
public static int daysInMonth(int month,
int year)
getDay
public int getDay()
getHours
public int getHours()
getMinutes
public int getMinutes()
getMonth
public int getMonth()
getNanoSecondsOnly
public int getNanoSecondsOnly()
getSecondsOnly
public int getSecondsOnly()
getWholeSeconds
public int getWholeSeconds()
getYear
public int getYear()
getZoneMinutes
public int getZoneMinutes()
isLeapYear
public static boolean isLeapYear(int year)
isZoneUnspecified
public boolean isZoneUnspecified()
minutesToTimeZone
public static TimeZone minutesToTimeZone(int minutes)
Get a TimeZone object for a given offset.
minutes
- timezone offset in minutes.
parse
public static DateTime parse(String value,
int mask)
setTimeZone
public void setTimeZone(TimeZone timeZone)
toString
public void toString(StringBuffer sbuf)
toStringDate
public void toStringDate(StringBuffer sbuf)
toStringTime
public void toStringTime(StringBuffer sbuf)
toStringZone
public void toStringZone(StringBuffer sbuf)
toStringZone
public static void toStringZone(int minutes,
StringBuffer sbuf)
withZoneUnspecified
public DateTime withZoneUnspecified()