time2jd()

Scientific results for this function.

All 499 calendar, clock, era, angle and setting checks in A01 passed. The largest discrepancy across 240 absolute Julian dates was 0.000021 seconds. A01 results.

Function index

Civil dates require both a calendar and a time convention to specify an instant. The function parses each supplied date and time, verifies that the calendar date exists by converting it to a Julian date and back, then applies the chosen offset or civil timezone to obtain UT. A date without a time uses local midnight. Astronomical year numbering includes year zero. An era label can also precede the month, for example "3700 BCE/06/21".

Fixed offsets may be numeric hours east of UTC (for example 5.5), or strings such as "UTC+05:30", "UTC-02" or "GMT+01". Offsets must lie between -14 and +14 hours. UTC, GMT and the empty string mean zero offset; an empty string does not select the system timezone.

Civil dates near local midnight.

Implementation arguments, return value and documented modes
Argument Formal default Behaviour in this interface
time —

Character vector in YYYY/MM/DD format, optionally followed by HH:MM or HH:MM:SS. Fractional seconds are accepted. Omitted clock time means midnight.

timezone —

Timezone name or fixed offset; defaults to the value in skyscapeR.vars(). See Details.

calendar —

Calendar: G or Gregorian, J or Julian. Defaults to the package calendar setting, initially Gregorian.

verbose F

Logical; display a conversion message. Default is FALSE.

Return value

A numeric vector of UT Julian dates, in the same order as time.

Implementation. R/dates.R. Full function help · Sky reconstruction · Ephemeris · Time, coordinates and ephemerides outline · Equinoctial full Moons and crescent crossovers · Astronomical conventions and stellar positions · The heliacal rising of the Pleiades · Exploring celestial candidates