gnu.math

Class DateTime

public class DateTime extends Quantity implements Cloneable

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..
Field Summary
static intDATE_MASK
static intDAY_MASK
static TimeZoneGMT
static intHOURS_MASK
static intMINUTES_MASK
static intMONTH_MASK
static intSECONDS_MASK
static intTIMEZONE_MASK
static intTIME_MASK
static intYEAR_MASK
Constructor Summary
DateTime(int mask)
DateTime(int mask, GregorianCalendar calendar)
Method Summary
static DateTimeadd(DateTime x, Duration y, int k)
Numericadd(Object y, int k)
static DateTimeaddMinutes(DateTime x, int y)
NumericaddReversed(Numeric x, int k)
static DateTimeaddSeconds(DateTime x, int y)
DateTimeadjustTimezone(int newOffset)
DateTimecast(int newComponents)
static intcompare(DateTime date1, DateTime date2)
Return -1, 0, or 1, depending on which value is greater.
intcompare(Object obj)
intcomponents()
static intdaysInMonth(int month, int year)
intgetDay()
intgetHours()
intgetMinutes()
intgetMonth()
intgetNanoSecondsOnly()
intgetSecondsOnly()
intgetWholeSeconds()
intgetYear()
intgetZoneMinutes()
booleanisExact()
static booleanisLeapYear(int year)
booleanisZero()
booleanisZoneUnspecified()
static TimeZoneminutesToTimeZone(int minutes)
Get a TimeZone object for a given offset.
Complexnumber()
static DateTimeparse(String value, int mask)
voidsetTimeZone(TimeZone timeZone)
static Durationsub(DateTime date1, DateTime date2)
voidtoString(StringBuffer sbuf)
StringtoString()
voidtoStringDate(StringBuffer sbuf)
voidtoStringTime(StringBuffer sbuf)
voidtoStringZone(StringBuffer sbuf)
static voidtoStringZone(int minutes, StringBuffer sbuf)
Unitunit()
DateTimewithZoneUnspecified()

Field Detail

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

Constructor Detail

DateTime

public DateTime(int mask)

DateTime

public DateTime(int mask, GregorianCalendar calendar)

Method Detail

add

public static DateTime add(DateTime x, Duration y, int k)

add

public Numeric add(Object y, int k)

addMinutes

public static DateTime addMinutes(DateTime x, int y)

addReversed

public Numeric addReversed(Numeric x, int k)

addSeconds

public static DateTime addSeconds(DateTime x, int y)

adjustTimezone

public DateTime adjustTimezone(int newOffset)

cast

public DateTime cast(int newComponents)

compare

public static int compare(DateTime date1, DateTime date2)
Return -1, 0, or 1, depending on which value is greater.

compare

public int compare(Object obj)

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()

isExact

public boolean isExact()

isLeapYear

public static boolean isLeapYear(int year)

isZero

public boolean isZero()

isZoneUnspecified

public boolean isZoneUnspecified()

minutesToTimeZone

public static TimeZone minutesToTimeZone(int minutes)
Get a TimeZone object for a given offset.

Parameters: minutes timezone offset in minutes.

number

public Complex number()

parse

public static DateTime parse(String value, int mask)

setTimeZone

public void setTimeZone(TimeZone timeZone)

sub

public static Duration sub(DateTime date1, DateTime date2)

toString

public void toString(StringBuffer sbuf)

toString

public String toString()

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)

unit

public Unit unit()

withZoneUnspecified

public DateTime withZoneUnspecified()