public enum EpochDays extends java.lang.Enum<EpochDays> implements ChronoElement<java.lang.Long>
Defines elements based on different epoch-related day numbers.
Some day number procedures really use decimal fractions in order to
represent wall time fractions in calendar dates (for example julian days).
This enum only supports pure date types of type Calendrical and
always uses the largest integer which is still smaller than or equal to
the decimal fraction in question (mathematically a
floor()-function.
Instances of this element class will be automatically registered in
any chronology which is compatible to Calendrical.
Calendrical| Enum Constant and Description |
|---|
ANSI
Count of days relative to the ISO-date [1601-01-01] as day 1.
|
EXCEL
Count of days relative to the ISO-date [1900-01-01] as day 1.
|
JULIAN_DAY_NUMBER
Count of julian days relative to the the julian calendar date
[1st of January 4713 BC] at noon [12:00] as day zero.
|
LILIAN_DAY_NUMBER
Count of days relative to gregorian cut-over date
[1582-10-15] as day 1.
|
MODIFIED_JULIAN_DATE
Count of days relative to the ISO-date [1858-11-17] as day zero.
|
RATA_DIE
Count of days relative to the ISO-date [0001-01-01] as day 1.
|
UNIX
Bezugspunkt ist der erste Januar 1970 Mitternacht als Tag 0.
|
UTC
Reference point is the introduction of UTC on date [1972-01-01]
at midnight as day zero.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(ChronoDisplay o1,
ChronoDisplay o2)
Applies an element-orientated sorting of any chronological
entities.
|
java.lang.Long |
getDefaultMaximum()
Returns the default maximum of this element which is not dependent
on the chronological context.
|
java.lang.Long |
getDefaultMinimum()
Returns the default minimum of this element which is not dependent
on the chronological context.
|
char |
getSymbol()
Defines the format symbol.
|
java.lang.Class<java.lang.Long> |
getType()
Yields the reified value type.
|
boolean |
isDateElement()
This element is a date element.
|
boolean |
isLenient()
Queries if setting of element values is performed in a lenient
way.
|
boolean |
isTimeElement()
This element is no wall time element.
|
long |
transform(long amount,
EpochDays epoch)
Converts given day number to a day number based on this epoch
at reference time of midnight.
|
static EpochDays |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static EpochDays[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOfnamepublic static final EpochDays UTC
Reference point is the introduction of UTC on date [1972-01-01] at midnight as day zero.
public static final EpochDays UNIX
Bezugspunkt ist der erste Januar 1970 Mitternacht als Tag 0.
Beispiel:
import static net.time4j.Month.FEBRUARY; PlainDate date = PlainDate.of(1970, FEBRUARY, 4); System.out.println(date.get(EpochDays.UNIX)); // Ausgabe: 34
Streng genommen wird die UNIX-Zeit in Sekunden gezählt. Dieses Element benutzt für den Zweck der Datumsumrechnung die Zählung in ganzen Tagen auf der Basis "1 Tag = 86400 Sekunden".
@FormattableElement(format="g") public static final EpochDays MODIFIED_JULIAN_DATE
Count of days relative to the ISO-date [1858-11-17] as day zero.
Used by astronomers for example.
public static final EpochDays EXCEL
Count of days relative to the ISO-date [1900-01-01] as day 1.
Used by MS-Excel in Windows operating systems.
public static final EpochDays ANSI
Count of days relative to the ISO-date [1601-01-01] as day 1.
Used by COBOL for example.
public static final EpochDays RATA_DIE
Count of days relative to the ISO-date [0001-01-01] as day 1.
Used by the autors Nachum Dershowitz and Edward M. Reingold in their standard work "CalendarDate Calculations".
public static final EpochDays JULIAN_DAY_NUMBER
Count of julian days relative to the the julian calendar date [1st of January 4713 BC] at noon [12:00] as day zero.
The julian epoch date corresponds to the proleptic ISO-date [-4713-11-24]. The ISO-day centered around noon will be taken into account whose associated julian day starts at noon.
public static final EpochDays LILIAN_DAY_NUMBER
Count of days relative to gregorian cut-over date [1582-10-15] as day 1.
public static EpochDays[] values()
for (EpochDays c : EpochDays.values()) System.out.println(c);
public static EpochDays valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic long transform(long amount,
EpochDays epoch)
Converts given day number to a day number based on this epoch at reference time of midnight.
amount - count of days relative to given epoch at noonepoch - epoch referencepublic java.lang.Class<java.lang.Long> getType()
ChronoElementYields the reified value type.
getType in interface ChronoElement<java.lang.Long>public char getSymbol()
Defines the format symbol.
getSymbol in interface ChronoElement<java.lang.Long>FormattableElementpublic int compare(ChronoDisplay o1, ChronoDisplay o2)
ChronoElementApplies an element-orientated sorting of any chronological entities.
The value type V is usually a subtype of the interface
Comparable so that this method will usually be based on
the expression o1.get(this).compareTo(o2.get(this)). In
other words, this method compares the element values of given
chronological entities. It is even permitted to compare entities
of different chronological types as long as the entities both
support this element.
It should be noted however that a element value comparison does often not induce any temporal (complete) order. Counter examples are the year of gregorian BC-era (reversed temporal order before Jesu birth) or the clock display of hours (12 is indeed the begin at midnight).
compare in interface java.util.Comparator<ChronoDisplay>compare in interface ChronoElement<java.lang.Long>o1 - the first object to be comparedo2 - the second object to be comparedpublic java.lang.Long getDefaultMinimum()
ChronoElementReturns the default minimum of this element which is not dependent on the chronological context.
Note: This minimum does not necessarily define a minimum for all possible circumstances but only the default minimum under normal conditions such that the default minimum always exists and can be used as prototypical value. An example is the start of day which is usually midnight in ISO-8601 and can only deviate in specialized timezone context.
getDefaultMinimum in interface ChronoElement<java.lang.Long>ChronoElement.getDefaultMaximum()public java.lang.Long getDefaultMaximum()
ChronoElementReturns the default maximum of this element which is not dependent on the chronological context.
Note: This maximum does not necessarily define a maximum for all
possible circumstances but only the default maximum under normal
conditions. An example is the second of minute whose default maximum
is 59 while the largest maximum can be 60 in context
of UTC-leapseconds.
getDefaultMaximum in interface ChronoElement<java.lang.Long>ChronoElement.getDefaultMinimum()public boolean isDateElement()
This element is a date element.
isDateElement in interface ChronoElement<java.lang.Long>trueChronoElement.isTimeElement()public boolean isTimeElement()
This element is no wall time element.
isTimeElement in interface ChronoElement<java.lang.Long>falseChronoElement.isDateElement()public boolean isLenient()
ChronoElementQueries if setting of element values is performed in a lenient way.
isLenient in interface ChronoElement<java.lang.Long>true if lenient else false (standard)ElementRule.withValue(T, V, boolean)