Modifier and Type | Method and Description |
---|---|
static LocalDateTime |
castOptional(DataValue value)
For internal use only.
|
static LocalDateTime |
castRequired(DataValue value)
For internal use only.
|
static int |
compare(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
int |
compareTo(LocalDateTime value)
Compare this dateTime with another dateTime.
|
static boolean |
equal(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
boolean |
equals(java.lang.Object value)
Compare this dateTime value with another dateTime value.
|
static LocalDateTime |
from(java.time.LocalDateTime jdt)
Convert from java.time.LocalDateTime.
|
DataType |
getDataType()
Return data type of the wrapped value.
|
LocalDate |
getDate()
Return local date component of dateTime.
|
int |
getDay()
Return day field of date (1 to 31).
|
int |
getDayOfWeek()
Return day of week (1 to 7).
|
int |
getDayOfYear()
Return day of year (1 to 366).
|
int |
getHour()
Return hour field of time (0 to 23).
|
int |
getMinute()
Return minute field of time (0 to 59).
|
int |
getMonth()
Return month field of date (1 to 12).
|
int |
getNano()
Return nanosecond field of time (0 to 999999999).
|
int |
getSecond()
Return second field of time (0 to 59).
|
LocalTime |
getTime()
Return local time component of dateTime.
|
int |
getYear()
Return year field of date.
|
boolean |
greaterEqual(LocalDateTime value)
Compare this dateTime value with another dateTime value.
|
boolean |
greaterThan(LocalDateTime value)
Compare this dateTime value with another dateTime value.
|
int |
hashCode()
Hash this data value to a number.
|
boolean |
lessEqual(LocalDateTime value)
Compare this dateTime value with another dateTime value.
|
boolean |
lessThan(LocalDateTime value)
Compare this dateTime value with another dateTime value.
|
static long |
millisBetween(LocalDateTime a,
LocalDateTime b)
Return the difference in milliseconds between two dateTime values
a and b , calculated as b - a . |
double |
minus(LocalDateTime value)
Return the difference
this - value , measured in days. |
boolean |
notEqual(LocalDateTime value)
Compare this dateTime value with another dateTime value.
|
static LocalDateTime |
now()
Return the current local dateTime.
|
static LocalDateTime |
of(int year,
int month,
int day,
int hour,
int minute,
int second)
|
static LocalDateTime |
of(int year,
int month,
int day,
int hour,
int minute,
int second,
int nano)
Return a new dateTime value.
|
static LocalDateTime |
ofMillis(long ms)
Convert a Java 'millis' time value to a LocalDateTime.
|
static LocalDateTime |
parse(java.lang.String text)
|
LocalDateTime |
plusDays(int days)
Return a new dateTime which is the specified number of days ahead of this dateTime.
|
LocalDateTime |
plusHours(long hours)
Return a new dateTime which is the specified number of hours ahead of this dateTime.
|
LocalDateTime |
plusMicros(long micros)
Return a new dateTime which is the specified number of microseconds ahead of this dateTime.
|
LocalDateTime |
plusMillis(long millis)
Return a new dateTime which is the specified number of milliseconds ahead of this dateTime.
|
LocalDateTime |
plusMinutes(long minutes)
Return a new dateTime which is the specified number of minutes ahead of this dateTime.
|
LocalDateTime |
plusMonths(int months)
Return a new dateTime which is the specified number of months ahead of this dateTime.
|
LocalDateTime |
plusNanos(long nanos)
Return a new dateTime which is the specified number of nanoseconds ahead of this dateTime.
|
LocalDateTime |
plusSeconds(long seconds)
Return a new dateTime which is the specified number of seconds ahead of this dateTime.
|
LocalDateTime |
plusWeeks(int weeks)
Return a new dateTime which is the specified number of weeks ahead of this dat/timee.
|
LocalDateTime |
plusYears(int years)
Return a new dateTime which is the specified number of years ahead of this dateTime.
|
static boolean |
static_greaterEqual(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
static boolean |
static_greaterThan(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
static boolean |
static_lessEqual(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
static boolean |
static_lessThan(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
static boolean |
static_notEqual(LocalDateTime left,
LocalDateTime right)
Compare two dateTime values.
|
GlobalDateTime |
toGlobal()
See toGlobal(int).
|
GlobalDateTime |
toGlobal(int offset)
Return this value converted to a global date and time, with specified offset.
|
java.time.LocalDateTime |
toJavaTime()
Convert to java.time.LocalDateTime.
|
static long |
toMillis(LocalDateTime dt)
Convert a LocalDateTime to a Java 'millis' time value.
|
java.lang.String |
toString()
Convert this data value to a string.
|
cloneMutable, getTypeCode
public static LocalDateTime from(java.time.LocalDateTime jdt)
jdt
- Java date/time value.public java.time.LocalDateTime toJavaTime()
public static LocalDateTime castOptional(DataValue value)
For internal use only.
value
- (internal use only)public static LocalDateTime castRequired(DataValue value)
For internal use only.
value
- (internal use only)public static int compare(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- The first dateTime for comparison.right
- The second dateTime for comparison.left < right
, 0 if left == right
, or 1 if left > right
.public int compareTo(LocalDateTime value)
Compare this dateTime with another dateTime.
value
- The other dateTime.public static boolean equal(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- (nullable) The first dateTime for comparison.right
- (nullable) The second dateTime for comparison.true
if left
is equal to right
, otherwise false
.public boolean equals(java.lang.Object value)
Compare this dateTime value with another dateTime value.
public DataType getDataType()
Return data type of the wrapped value.
getDataType
in class DataValue
public LocalDate getDate()
Return local date component of dateTime.
public int getDay()
Return day field of date (1 to 31).
public int getDayOfWeek()
Return day of week (1 to 7).
public int getDayOfYear()
Return day of year (1 to 366).
public int getHour()
Return hour field of time (0 to 23).
public int getMinute()
Return minute field of time (0 to 59).
public int getMonth()
Return month field of date (1 to 12).
public int getNano()
Return nanosecond field of time (0 to 999999999).
public int getSecond()
Return second field of time (0 to 59).
public LocalTime getTime()
Return local time component of dateTime.
public int getYear()
Return year field of date.
public boolean greaterEqual(LocalDateTime value)
Compare this dateTime value with another dateTime value.
value
- The other dateTime value.true
if this dateTime value is greater than or equal to the value dateTime value. Oherwise false
.public boolean greaterThan(LocalDateTime value)
Compare this dateTime value with another dateTime value.
value
- The other dateTime value.true
if this dateTime value is greater than the value dateTime value. Oherwise false
.public int hashCode()
Hash this data value to a number.
public boolean lessEqual(LocalDateTime value)
Compare this dateTime value with another dateTime value.
value
- The other dateTime value.true
if this dateTime value is less than or equal to the value dateTime value. Oherwise false
.public boolean lessThan(LocalDateTime value)
Compare this dateTime value with another dateTime value.
value
- The other dateTime value.true
if this dateTime value is less than the value dateTime value. Oherwise false
.public static long millisBetween(LocalDateTime a, LocalDateTime b)
Return the difference in milliseconds between two dateTime values a
and b
, calculated as b - a
.
a
- The first dateTime value.b
- The second dateTime value.a
and b
, calculated as b - a
.public double minus(LocalDateTime value)
Return the difference this - value
, measured in days.
value
- The other dateTime.this - value
, measured in days.public boolean notEqual(LocalDateTime value)
Compare this dateTime value with another dateTime value.
value
- The other dateTime value.true
if this dateTime value is not equal to the value dateTime value. Oherwise false
.public static LocalDateTime now()
Return the current local dateTime.
public static LocalDateTime of(int year, int month, int day, int hour, int minute, int second)
year
- Year parameter.month
- Month parameter.day
- Day parameter.hour
- Hour parameter.minute
- Minute parameter.second
- Second parameter.public static LocalDateTime of(int year, int month, int day, int hour, int minute, int second, int nano)
Return a new dateTime value.
year
- The year field.month
- The month field (1 to 12).day
- The day field (1 to 31).hour
- The hour field (0 to 23).minute
- The minute field (0 to 59).second
- The second field (0 to 59).nano
- The nano field (0 to 999999999).public static LocalDateTime ofMillis(long ms)
Convert a Java 'millis' time value to a LocalDateTime.
ms
- Milliseconds since 1970-01-01T00:00:00Z (UTC).public static LocalDateTime parse(java.lang.String text)
Return (nullable) Value parsed from XML Schema format, or null
if text
has invalid dateTime format.
text
- Value in XML Schema format.null
if text
has invalid dateTime format.public LocalDateTime plusDays(int days)
Return a new dateTime which is the specified number of days ahead of this dateTime.
days
- Number of days to add. Can be negative, zero or positive.public LocalDateTime plusHours(long hours)
Return a new dateTime which is the specified number of hours ahead of this dateTime.
hours
- Number of hours to add. Can be negative, zero or positive.public LocalDateTime plusMicros(long micros)
Return a new dateTime which is the specified number of microseconds ahead of this dateTime.
micros
- Number of microseconds to add. Can be negative, zero or positive.public LocalDateTime plusMillis(long millis)
Return a new dateTime which is the specified number of milliseconds ahead of this dateTime.
millis
- Number of milliseconds to add. Can be negative, zero or positive.public LocalDateTime plusMinutes(long minutes)
Return a new dateTime which is the specified number of minutes ahead of this dateTime.
minutes
- Number of minutes to add. Can be negative, zero or positive.public LocalDateTime plusMonths(int months)
Return a new dateTime which is the specified number of months ahead of this dateTime.
months
- Number of months to add. Can be negative, zero or positive.public LocalDateTime plusNanos(long nanos)
Return a new dateTime which is the specified number of nanoseconds ahead of this dateTime.
nanos
- Number of nanoseconds to add. Can be negative, zero or positive.public LocalDateTime plusSeconds(long seconds)
Return a new dateTime which is the specified number of seconds ahead of this dateTime.
seconds
- Number of seconds to add. Can be negative, zero or positive.public LocalDateTime plusWeeks(int weeks)
Return a new dateTime which is the specified number of weeks ahead of this dat/timee.
weeks
- Number of weeks to add. Can be negative, zero or positive.public LocalDateTime plusYears(int years)
Return a new dateTime which is the specified number of years ahead of this dateTime.
years
- Number of years to add. Can be negative, zero or positive.public static boolean static_greaterEqual(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- The first dateTime for comparison.right
- The second dateTime for comparison.true
if left
is greater than or equal to right
, otherwise false
.public static boolean static_greaterThan(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- The first dateTime for comparison.right
- The second dateTime for comparison.true
if left
is greater than right
, otherwise false
.public static boolean static_lessEqual(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- The first dateTime for comparison.right
- The second dateTime for comparison.true
if left
is less than or equal to right
, otherwise false
.public static boolean static_lessThan(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- The first dateTime for comparison.right
- The second dateTime for comparison.true
if left
is less than right
, otherwise false
.public static boolean static_notEqual(LocalDateTime left, LocalDateTime right)
Compare two dateTime values.
left
- (nullable) The first dateTime for comparison.right
- (nullable) The second dateTime for comparison.true
if left
is not equal to right
, otherwise false
.public GlobalDateTime toGlobal()
public GlobalDateTime toGlobal(int offset)
Return this value converted to a global date and time, with specified offset.
offset
- Zone offset in minutes.public static long toMillis(LocalDateTime dt)
Convert a LocalDateTime to a Java 'millis' time value.
dt
- Local date/time, in computer's local timezone.public java.lang.String toString()
Convert this data value to a string.
If the LocalDateTime.dataType
is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used.
JSON format is used for structured values (arrays and objects).