public interface DateTime extends OsidPrimitive, DateTime
The DateTime interface defines a date and/or time. This interface provides a very broad range of dates, describes more or less precision, and/or conveys an uncertainty. A number of convenience methods for retrieving time elements are available but only those methods covered by the specified granularity are valid.
A typical example is describing a day where the time isn't known, and the event did not occur at midnight.
getMillennium() == 2 getCentury() == 18 getYear() == 1776 getMonth() == 7 getDay() == 4 getHour() == 0 getGranularity() == DateTimeResolution.DAY definesUncertainty() == false
Another example showing that the time is probably 1pm but could have been as late as 3pm or early as noon.
getMillennium() == 3 getCentury() == 21 getYear() == 2008 getMonth() == 3 getDay() == 17 getHour() == 13 getMinute() == 0 getGranularity() == TimeResolution.MINUTE definesUncertainty() == true getUncertaintyGranularity() == DateTimeResolution.HOUR getUncertaintyMinus() == 1 getUncertaintyPlus == 2
An example marking the birth of the universe. 13.73 billion years +/- 120 million years. The granularity suggests that no more resolution than one million years can be inferred from the "clock", making errors in the exact number of millennia insignificant.
getEpoch() == -13,730 getMillennium() == 0 getCentury() == 0 getYear() == 0 getGranularity() == TimeResolution.EPOCH definesUncertainty() == true getUncertaintyGranularity() == DateTimeResolution.EPOCH getUncertaintyMinus() == 120 getUncertaintyPlus == 120
Modifier and Type | Method and Description |
---|---|
boolean |
definesUncertainty()
Tests if uncertainty is defined for this time.
|
long |
getAeon()
Gets the aeon starting from 1.
|
long |
getAttoseconds()
Gets the number of attoseconds of the femtoseconds 0-999.
|
Type |
getCalendarType()
Gets the calendar type.
|
long |
getCentury()
Gets the century starting from 1.
|
long |
getDay()
Gets the day of the month starting from 1.
|
long |
getEpoch()
Gets the epoch starting from 1.
|
long |
getFemtoseconds()
Gets the number of femtoseconds of the picosecond 0-999.
|
DateTimeResolution |
getGranularity()
Gets the granularity of this time.
|
long |
getGranularityMultiplier()
If the granularity of the time equals
getGranularity(),
then the multiplier is 1. |
long |
getHour()
Gets the hour of the day 0-23.
|
long |
getMicroseconds()
Gets the number of microseconds of the second 0-999.
|
long |
getMillennium()
Gets the millennium starting from 1.
|
long |
getMilliseconds()
Gets the number of milliseconds in this second 0-999.
|
long |
getMinute()
Gets the minute of the hour 0-59.
|
long |
getMonth()
Gets the month number starting from 1.
|
long |
getNanoseconds()
Gets the number of nanoseconds of the microsecond 0-999.
|
long |
getPicoseconds()
Gets the number of picoseconds of the nanosecond 0-999.
|
long |
getPlanckSeconds()
Gets the number of Plancks of the vatoseconds.
|
long |
getSecond()
Gets the second of the minute 0-59.
|
Type |
getTimeType()
Gets the time type.
|
long |
getUncertaintyMinus()
Gets the uncertainty of this time in the negative direction.
|
long |
getUncertaintyPlus()
Gets the uncertainty of this time in the positive direction.
|
DateTimeResolution |
getUncertaintyUnits()
Gets the units of the uncertainty.
|
long |
getUndaseconds()
Gets the number of undaseconds of the vatosecond 0-999.
|
long |
getVatoseconds()
Gets the number of vatoseconds of the xoxxosecond 0-999.
|
long |
getWeebleseconds()
Gets the number of weebleseconds of the xoxxosecond 0-999.
|
long |
getXoxxoseconds()
Gets the number of xoxxoseconds of the yoctosecond 0-999.
|
long |
getYear()
Gets the year starting from 1.
|
long |
getYoctoseconds()
Gets the number of yoctoseconds of the picosecond 0-999.
|
long |
getZeptoseconds()
Gets the number of zeptoseconds of the attosecond 0-999.
|
boolean |
isUncertaintyDateInclusive()
Tests if the uncertainty is inclusive of all dates.
|
boolean |
isUncertaintyTimeInclusive()
Tests if the uncertainty is time inclusive.
|
compareTo, denormalize, equals, hashCode, isExclusive, isGreater, isInclusive, isLess
toString
Type getCalendarType()
mandatory
- This method must be implemented. long getAeon()
mandatory
- This method must be implemented. long getEpoch()
mandatory
- This method must be implemented. long getMillennium()
mandatory
- This method must be implemented. long getCentury()
mandatory
- This method must be implemented. long getYear()
mandatory
- This method must be implemented. long getMonth()
mandatory
- This method must be implemented. long getDay()
mandatory
- This method must be implemented. Type getTimeType()
mandatory
- This method must be implemented. long getHour()
mandatory
- This method must be implemented. long getMinute()
mandatory
- This method must be implemented. long getSecond()
mandatory
- This method must be implemented. long getMilliseconds()
mandatory
- This method must be implemented. long getMicroseconds()
mandatory
- This method must be implemented. long getNanoseconds()
mandatory
- This method must be implemented. long getPicoseconds()
mandatory
- This method must be implemented. long getFemtoseconds()
mandatory
- This method must be implemented. long getAttoseconds()
mandatory
- This method must be implemented. long getZeptoseconds()
mandatory
- This method must be implemented. long getYoctoseconds()
mandatory
- This method must be implemented. long getXoxxoseconds()
mandatory
- This method must be implemented. long getWeebleseconds()
mandatory
- This method must be implemented. long getVatoseconds()
mandatory
- This method must be implemented. long getUndaseconds()
mandatory
- This method must be implemented. long getPlanckSeconds()
mandatory
- This method must be implemented. DateTimeResolution getGranularity()
mandatory
- This method must be implemented. long getGranularityMultiplier()
getGranularity(),
then the multiplier is 1. This method may return a different number
when the granularity differs from one of the defined resolutions.mandatory
- This method must be implemented. boolean definesUncertainty()
true
if uncertainty is defined, false
otherwisemandatory
- This method must be implemented. DateTimeResolution getUncertaintyUnits()
IllegalStateException
- definesUncertainty()
is false
mandatory
- This method must be implemented. long getUncertaintyMinus()
IllegalStateException
- definesUncertainty()
is false
mandatory
- This method must be implemented. long getUncertaintyPlus()
IllegalStateException
- definesUncertainty()
is false
mandatory
- This method must be implemented. boolean isUncertaintyDateInclusive()
true
if the uncertainty includes all dates,
false
otherwiseIllegalStateException
- definesUncertainty()
is false
mandatory
- This method must be implemented. boolean isUncertaintyTimeInclusive()
true
if the uncertainty includes all times,
false
otherwiseIllegalStateException
- definesUncertainty()
is false
mandatory
- This method must be implemented.