| java.lang.Object org.joda.time.base.AbstractInstant org.joda.time.base.AbstractDateTime org.joda.time.base.BaseDateTime
All known Subclasses: org.joda.time.MutableDateTime, org.joda.time.DateTime, org.joda.time.DateMidnight,
BaseDateTime | abstract public class BaseDateTime extends AbstractDateTime implements ReadableDateTime,Serializable(Code) | | BaseDateTime is an abstract implementation of ReadableDateTime that stores
data in 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.
author: Stephen Colebourne author: Kandarp Shah author: Brian S O'Neill since: 1.0 |
Constructor Summary | |
public | BaseDateTime() Constructs an instance set to the current system millisecond time
using ISOChronology in the default time zone. | public | BaseDateTime(DateTimeZone zone) Constructs an instance set to the current system millisecond time
using ISOChronology in the specified time zone. | public | BaseDateTime(Chronology chronology) Constructs an instance set to the current system millisecond time
using the specified chronology. | public | BaseDateTime(long instant) Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using ISOChronology in the default time zone. | public | 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. | public | BaseDateTime(long instant, Chronology chronology) Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using the specified chronology. | public | BaseDateTime(Object instant, DateTimeZone zone) Constructs an instance from an Object that represents a datetime,
forcing the time zone to that specified. | public | BaseDateTime(Object instant, Chronology chronology) Constructs an instance from an Object that represents a datetime,
using the specified chronology. | public | 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. | public | 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. | public | 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. |
Method Summary | |
protected Chronology | checkChronology(Chronology chronology) Checks the specified chronology before storing it, potentially altering it. | protected long | checkInstant(long instant, Chronology chronology) Checks the specified instant before storing it, potentially altering it. | public Chronology | getChronology() Gets the chronology of the datetime. | public long | getMillis() Gets the milliseconds of the datetime instant from the Java epoch
of 1970-01-01T00:00:00Z. | protected void | setChronology(Chronology chronology) Sets the chronology of the datetime. | protected void | setMillis(long instant) Sets the milliseconds of the datetime. |
BaseDateTime | public BaseDateTime()(Code) | | Constructs an instance set to the current system millisecond time
using ISOChronology in the default time zone.
|
BaseDateTime | public BaseDateTime(DateTimeZone zone)(Code) | | Constructs an instance set to the current system millisecond time
using ISOChronology in the specified time zone.
If the specified time zone is null, the default zone is used.
Parameters: zone - the time zone, null means default zone |
BaseDateTime | public BaseDateTime(Chronology chronology)(Code) | | Constructs an instance set to the current system millisecond time
using the specified chronology.
If the chronology is null, ISOChronology
in the default time zone is used.
Parameters: chronology - the chronology, null means ISOChronology in default zone |
BaseDateTime | public BaseDateTime(long instant)(Code) | | Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using ISOChronology in the default time zone.
Parameters: instant - the milliseconds from 1970-01-01T00:00:00Z |
BaseDateTime | public BaseDateTime(long instant, DateTimeZone zone)(Code) | | Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using ISOChronology in the specified time zone.
If the specified time zone is null, the default zone is used.
Parameters: instant - the milliseconds from 1970-01-01T00:00:00Z Parameters: zone - the time zone, null means default zone |
BaseDateTime | public BaseDateTime(long instant, Chronology chronology)(Code) | | Constructs an instance set to the milliseconds from 1970-01-01T00:00:00Z
using the specified chronology.
If the chronology is null, ISOChronology
in the default time zone is used.
Parameters: instant - the milliseconds from 1970-01-01T00:00:00Z Parameters: chronology - the chronology, null means ISOChronology in default zone |
BaseDateTime | public BaseDateTime(Object instant, DateTimeZone zone)(Code) | | Constructs an instance from an Object that represents a datetime,
forcing the time zone to that specified.
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
org.joda.time.convert.ConverterManager ConverterManager and
include ReadableInstant, String, Calendar and Date.
Parameters: instant - the datetime object Parameters: zone - the time zone throws: IllegalArgumentException - if the instant is invalid |
BaseDateTime | public BaseDateTime(Object instant, Chronology chronology)(Code) | | Constructs an instance from an Object that represents a datetime,
using the specified chronology.
If the chronology is null, ISO in the default time zone is used.
The recognised object types are defined in
org.joda.time.convert.ConverterManager ConverterManager and
include ReadableInstant, String, Calendar and Date.
Parameters: instant - the datetime object Parameters: chronology - the chronology throws: IllegalArgumentException - if the instant is invalid |
BaseDateTime | public BaseDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)(Code) | | Constructs an instance from datetime field values
using ISOChronology in the default time zone.
Parameters: year - the year Parameters: monthOfYear - the month of the year Parameters: dayOfMonth - the day of the month Parameters: hourOfDay - the hour of the day Parameters: minuteOfHour - the minute of the hour Parameters: secondOfMinute - the second of the minute Parameters: millisOfSecond - the millisecond of the second |
BaseDateTime | public BaseDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, DateTimeZone zone)(Code) | | Constructs an instance from datetime field values
using ISOChronology in the specified time zone.
If the specified time zone is null, the default zone is used.
Parameters: year - the year Parameters: monthOfYear - the month of the year Parameters: dayOfMonth - the day of the month Parameters: hourOfDay - the hour of the day Parameters: minuteOfHour - the minute of the hour Parameters: secondOfMinute - the second of the minute Parameters: millisOfSecond - the millisecond of the second Parameters: zone - the time zone, null means default time zone |
BaseDateTime | public BaseDateTime(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, Chronology chronology)(Code) | | Constructs an instance from datetime field values
using the specified chronology.
If the chronology is null, ISOChronology
in the default time zone is used.
Parameters: year - the year Parameters: monthOfYear - the month of the year Parameters: dayOfMonth - the day of the month Parameters: hourOfDay - the hour of the day Parameters: minuteOfHour - the minute of the hour Parameters: secondOfMinute - the second of the minute Parameters: millisOfSecond - the millisecond of the second Parameters: chronology - the chronology, null means ISOChronology in default zone |
checkChronology | protected Chronology checkChronology(Chronology chronology)(Code) | | Checks the specified chronology before storing it, potentially altering it.
This method must not access any instance variables.
This implementation converts nulls to ISOChronology in the default zone.
Parameters: chronology - the chronology to use, may be null the chronology to store in this datetime, not null |
checkInstant | protected long checkInstant(long instant, Chronology chronology)(Code) | | Checks the specified instant before storing it, potentially altering it.
This method must not access any instance variables.
This implementation simply returns the instant.
Parameters: instant - the milliseconds from 1970-01-01T00:00:00Z to round Parameters: chronology - the chronology to use, not null the instant to store in this datetime |
getChronology | public Chronology getChronology()(Code) | | Gets the chronology of the datetime.
the Chronology that the datetime is using |
getMillis | public long getMillis()(Code) | | Gets the milliseconds of the datetime instant from the Java epoch
of 1970-01-01T00:00:00Z.
the number of milliseconds since 1970-01-01T00:00:00Z |
setChronology | protected void setChronology(Chronology chronology)(Code) | | Sets the chronology of the datetime.
All changes to the chronology field occurs via this method.
Override and block this method to make a subclass immutable.
Parameters: chronology - the chronology to set |
setMillis | protected void setMillis(long instant)(Code) | | Sets the milliseconds of the datetime.
All changes to the millisecond field occurs via this method.
Override and block this method to make a subclass immutable.
Parameters: instant - the milliseconds since 1970-01-01T00:00:00Z to set the datetime to |
|
|