public class DateTime extends Quantity implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
DATE_MASK |
static int |
DAY_MASK |
static java.util.TimeZone |
GMT |
static int |
HOURS_MASK |
static int |
MINUTES_MASK |
static int |
MONTH_MASK |
static int |
SECONDS_MASK |
static int |
TIME_MASK |
static int |
TIMEZONE_MASK |
static int |
YEAR_MASK |
Constructor and Description |
---|
DateTime(int mask) |
DateTime(int mask,
java.util.GregorianCalendar calendar) |
Modifier and Type | Method and Description |
---|---|
static DateTime |
add(DateTime x,
Duration y,
int k) |
Numeric |
add(java.lang.Object y,
int k)
Return this + k * obj.
|
static DateTime |
addMinutes(DateTime x,
int y) |
Numeric |
addReversed(Numeric x,
int k)
Calculate
x+k&this . |
static DateTime |
addSeconds(DateTime x,
int y) |
DateTime |
adjustTimezone(int newOffset) |
DateTime |
cast(int newComponents) |
static int |
compare(DateTime date1,
DateTime date2)
Return -1, 0, or 1, depending on which value is greater.
|
int |
compare(java.lang.Object obj)
Return an integer for which of
this or obj is larger. |
int |
components() |
static int |
daysInMonth(int month,
int year) |
int |
getDay() |
int |
getHours() |
int |
getMinutes() |
int |
getMonth() |
int |
getNanoSecondsOnly() |
int |
getSecondsOnly() |
int |
getWholeSeconds() |
int |
getYear() |
int |
getZoneMinutes() |
boolean |
isExact() |
static boolean |
isLeapYear(int year) |
boolean |
isZero() |
boolean |
isZoneUnspecified() |
static java.util.TimeZone |
minutesToTimeZone(int minutes)
Get a TimeZone object for a given offset.
|
Complex |
number() |
static DateTime |
parse(java.lang.String value,
int mask) |
void |
setTimeZone(java.util.TimeZone timeZone) |
static Duration |
sub(DateTime date1,
DateTime date2) |
java.lang.String |
toString() |
void |
toString(java.lang.StringBuffer sbuf) |
void |
toStringDate(java.lang.StringBuffer sbuf) |
void |
toStringTime(java.lang.StringBuffer sbuf) |
static void |
toStringZone(int minutes,
java.lang.StringBuffer sbuf) |
void |
toStringZone(java.lang.StringBuffer sbuf) |
Unit |
unit() |
DateTime |
withZoneUnspecified() |
abs, add, compare, compareReversed, dimensions, div, divide, divReversed, doubleImagValue, doubleJmagValue, doubleKmagValue, doubleValue, im, imValue, jm, jmValue, km, kmValue, make, make, make, mul, mulReversed, neg, re, reValue, times, toString
public static final int YEAR_MASK
public static final int MONTH_MASK
public static final int DAY_MASK
public static final int HOURS_MASK
public static final int MINUTES_MASK
public static final int SECONDS_MASK
public static final int TIMEZONE_MASK
public static final int DATE_MASK
public static final int TIME_MASK
public static java.util.TimeZone GMT
public DateTime(int mask)
public DateTime(int mask, java.util.GregorianCalendar calendar)
public int components()
public DateTime cast(int newComponents)
public static DateTime parse(java.lang.String value, int mask)
public static boolean isLeapYear(int year)
public static int daysInMonth(int month, int year)
public int getYear()
public int getMonth()
public int getDay()
public int getHours()
public int getMinutes()
public int getSecondsOnly()
public int getWholeSeconds()
public int getNanoSecondsOnly()
public static int compare(DateTime date1, DateTime date2)
public int compare(java.lang.Object obj)
Numeric
this
or obj
is larger.
Return 1 if this>obj
; 0 if this==obj
;
-1 if this<obj
;
-2 if this!=obj
otherwise (for example if either is NaN);
-3 if not comparable (incompatible types).public DateTime withZoneUnspecified()
public DateTime adjustTimezone(int newOffset)
public Numeric add(java.lang.Object y, int k)
Numeric
public Numeric addReversed(Numeric x, int k)
Numeric
x+k&this
.addReversed
in class Quantity
public void toStringDate(java.lang.StringBuffer sbuf)
public void toStringTime(java.lang.StringBuffer sbuf)
public boolean isZoneUnspecified()
public int getZoneMinutes()
public static java.util.TimeZone minutesToTimeZone(int minutes)
minutes
- timezone offset in minutes.public void setTimeZone(java.util.TimeZone timeZone)
public void toStringZone(java.lang.StringBuffer sbuf)
public static void toStringZone(int minutes, java.lang.StringBuffer sbuf)
public void toString(java.lang.StringBuffer sbuf)