Class JulianDate
java.lang.Object
org.shredzone.commons.suncalc.util.JulianDate
This class contains a Julian Date representation of a date.
Objects are immutable and threadsafe.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionatHour
(double hour) Returns aJulianDate
of the current date and the given hour.atJulianCentury
(double jc) Returns aJulianDate
of the given Julian century.atModifiedJulianDate
(double mjd) Returns aJulianDate
of the given modified Julian date.Returns thisJulianDate
asZonedDateTime
object.double
Returns the Greenwich Mean Sidereal Time of this Julian Date.double
Returns the Julian Centuries.double
Returns the Modified Julian Date.double
Returns the earth's true anomaly of the current date.toString()
-
Constructor Details
-
JulianDate
Creates a newJulianDate
.- Parameters:
time
-ZonedDateTime
to use for the date.
-
-
Method Details
-
atHour
Returns aJulianDate
of the current date and the given hour.- Parameters:
hour
- Hour of this date. This is a floating point value. Fractions are used for minutes and seconds.- Returns:
JulianDate
instance.
-
atModifiedJulianDate
Returns aJulianDate
of the given modified Julian date.- Parameters:
mjd
- Modified Julian Date- Returns:
JulianDate
instance.
-
atJulianCentury
Returns aJulianDate
of the given Julian century.- Parameters:
jc
- Julian Century- Returns:
JulianDate
instance.
-
getDateTime
Returns thisJulianDate
asZonedDateTime
object.- Returns:
ZonedDateTime
of thisJulianDate
.
-
getModifiedJulianDate
Returns the Modified Julian Date.- Returns:
- Modified Julian Date, UTC.
-
getJulianCentury
Returns the Julian Centuries.- Returns:
- Julian Centuries, based on J2000 epoch, UTC.
-
getGreenwichMeanSiderealTime
Returns the Greenwich Mean Sidereal Time of this Julian Date.- Returns:
- GMST
-
getTrueAnomaly
Returns the earth's true anomaly of the current date.A simple approximation is used here.
- Returns:
- True anomaly, in radians
-
toString
-