Sun position
Sun position algorithm
Time variables

Astronomical algorithms typically use a simple number as the time variable. This can take one of several forms:

  • Julian Date (JD). The number of days since Greenwich noon, 1 January 4713 BC (on the Julian calendar, as if it had existed back then). So for example 2020-04-13 9:00 am is 2458952.875
  • Modified Julian Date (MJD). The Julian Date minus 2 400 000.5. This makes it the number of days since Greenwich midnight at the start of 1858-11-17. So for example, 2020-04-13 9:00 am is 58952.375
  • J2KD (My abbreviation). Days since Greenwich noon, 2000-01-01. Equals JD - 2 451 545.0 (= MJD - 51544.5). So for example, 2020-04-13 9:00 am is 7407.875

The three above could easily represent times in the TT or UT1 timescales, so the relevant timescale should be specified. (See Timescales, and converting between them)

  • J2KC (My abbreviation). Julian centuries since Greenwich noon, 2000-01-01. Equals J2KD ÷ 36525
  • J2KM (My abbreviation). Julian millennia since Greenwich noon, 2000-01-01. Equals J2KC ÷ 10

Typically the two above will be used for times in the TT timescale.

  • Julian epoch (e.g. J2000.0 or J2020.5). Calculated from J[2000.0 + J2KD / 365.25], TT timescale. This is used for star catalogue positions. For example, J2000.0 is JD 2 451 545.0. And 2-Jul-2020 3:00:00 (TT) is J2020.5
  • Besselian epoch (e.g. B1950.0). This is calculated from B[1900.0 + JD - (2 415 020.313 52) / 365.242 198 781]. So B1950.0 is JD 2 433 282.423. Besselian epochs are often associated with FK4 catalogue positions. These are not supported by this software (yet).

Many astronomical algorithms use one of the forms based on time since J2000.0 (i.e. either J2KD, J2KC or J2KM) as their time variable. For this reason, the conversion routines from calendar date/time (sky_calTimeToJ2kd())and from the unix time_t and timespec formats (sky_unixTimeToJ2kd() and sky_unixTimespecToJ2kd()) return a variable in the J2KD form (rather than the JD or MJD forms).