public abstract class BaseDateTime extends AbstractDateTime implements ReadableDateTime, java.io.Serializable
long
and Chronology
fields.
This class should generally not be used directly by API users.
The ReadableDateTime
interface should be used when different
kinds of date/time objects are to be referenced.
BaseDateTime subclasses may be mutable and not thread-safe.
Constructor and Description |
---|
BaseDateTime()
Constructs an instance set to the current system millisecond time
using
ISOChronology in the default time zone. |
BaseDateTime(Chronology chronology)
Constructs an instance set to the current system millisecond time
using the specified chronology.
|
BaseDateTime(DateTimeZone zone)
Constructs an instance set to the current system millisecond time
using
ISOChronology in the specified time zone. |
BaseDateTime(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond)
Constructs an instance from datetime field values
using
ISOChronology in the default time zone. |
BaseDateTime(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond,
Chronology chronology)
Constructs an instance from datetime field values
using the specified chronology.
|
BaseDateTime(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond,
DateTimeZone zone)
Constructs an instance from datetime field values
using
ISOChronology in the specified time zone. |
BaseDateTime(long instant)
Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using
ISOChronology in the default time zone. |
BaseDateTime(long instant,
Chronology chronology)
Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using the specified chronology.
|
BaseDateTime(long instant,
DateTimeZone zone)
Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using
ISOChronology in the specified time zone. |
BaseDateTime(java.lang.Object instant,
Chronology chronology)
Constructs an instance from an Object that represents a datetime,
using the specified chronology.
|
BaseDateTime(java.lang.Object instant,
DateTimeZone zone)
Constructs an instance from an Object that represents a datetime,
forcing the time zone to that specified.
|
Modifier and Type | Method and Description |
---|---|
Chronology |
getChronology()
Gets the chronology of the datetime.
|
long |
getMillis()
Gets the milliseconds of the datetime instant from the Java epoch
of 1970-01-01T00:00:00Z.
|
get, getCenturyOfEra, getDayOfMonth, getDayOfWeek, getDayOfYear, getEra, getHourOfDay, getMillisOfDay, getMillisOfSecond, getMinuteOfDay, getMinuteOfHour, getMonthOfYear, getSecondOfDay, getSecondOfMinute, getWeekOfWeekyear, getWeekyear, getYear, getYearOfCentury, getYearOfEra, toCalendar, toGregorianCalendar, toString, toString, toString
compareTo, equals, get, getZone, hashCode, isAfter, isAfter, isAfterNow, isBefore, isBefore, isBeforeNow, isEqual, isEqual, isEqualNow, isSupported, toDate, toDateTime, toDateTime, toDateTime, toDateTimeISO, toInstant, toMutableDateTime, toMutableDateTime, toMutableDateTime, toMutableDateTimeISO, toString
getCenturyOfEra, getDayOfMonth, getDayOfWeek, getDayOfYear, getEra, getHourOfDay, getMillisOfDay, getMillisOfSecond, getMinuteOfDay, getMinuteOfHour, getMonthOfYear, getSecondOfDay, getSecondOfMinute, getWeekOfWeekyear, getWeekyear, getYear, getYearOfCentury, getYearOfEra, toDateTime, toMutableDateTime, toString, toString
public BaseDateTime()
ISOChronology
in the default time zone.public BaseDateTime(DateTimeZone zone)
ISOChronology
in the specified time zone.
If the specified time zone is null, the default zone is used.
zone
- the time zone, null means default zonepublic BaseDateTime(Chronology chronology)
If the chronology is null, ISOChronology
in the default time zone is used.
chronology
- the chronology, null means ISOChronology in default zonepublic BaseDateTime(long instant)
ISOChronology
in the default time zone.instant
- the milliseconds from 1970-01-01T00:00:00Zpublic BaseDateTime(long instant, DateTimeZone zone)
ISOChronology
in the specified time zone.
If the specified time zone is null, the default zone is used.
instant
- the milliseconds from 1970-01-01T00:00:00Zzone
- the time zone, null means default zonepublic BaseDateTime(long instant, Chronology chronology)
If the chronology is null, ISOChronology
in the default time zone is used.
instant
- the milliseconds from 1970-01-01T00:00:00Zchronology
- the chronology, null means ISOChronology in default zonepublic BaseDateTime(java.lang.Object instant, DateTimeZone zone)
If the object contains no chronology, ISOChronology
is used.
If the specified time zone is null, the default zone is used.
The recognised object types are defined in
ConverterManager
and
include ReadableInstant, String, Calendar and Date.
instant
- the datetime objectzone
- the time zonejava.lang.IllegalArgumentException
- if the instant is invalidpublic BaseDateTime(java.lang.Object instant, Chronology chronology)
If the chronology is null, ISO in the default time zone is used.
The recognised object types are defined in
ConverterManager
and
include ReadableInstant, String, Calendar and Date.
instant
- the datetime objectchronology
- the chronologyjava.lang.IllegalArgumentException
- if the instant is invalidpublic BaseDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
ISOChronology
in the default time zone.year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the secondpublic BaseDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, DateTimeZone zone)
ISOChronology
in the specified time zone.
If the specified time zone is null, the default zone is used.
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the secondzone
- the time zone, null means default time zonepublic BaseDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, Chronology chronology)
If the chronology is null, ISOChronology
in the default time zone is used.
year
- the yearmonthOfYear
- the month of the yeardayOfMonth
- the day of the monthhourOfDay
- the hour of the dayminuteOfHour
- the minute of the hoursecondOfMinute
- the second of the minutemillisOfSecond
- the millisecond of the secondchronology
- the chronology, null means ISOChronology in default zonepublic long getMillis()
getMillis
in interface ReadableInstant
public Chronology getChronology()
getChronology
in interface ReadableInstant
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"