Learn R Programming

astroFns (version 4.2-1)

ymd2jd: Year, month, day to 0h on Julian day

Description

Convert year, month, day to 0h on Julian day.

Usage

ymd2jd(yr = 2012, mo = 1, dy = 1)

Arguments

yr

UT1 Year

mo

UT1 Month number

dy

UT1 Day number

Value

Julian date

Details

Returns Julian date of 0 hours on the specified day. To get to noon on day, the time origin of Julian days, add 0.5.

References

Fliegel & Van Flandern, Comm. ACM 10, 657 (1968), whose algorithm uses FORTRAN integer mathematics. See also the Explanatory Supplement to the Astronomical Almanac, ed. P.K. Seidelmann, c. 1992.

See Also

weekdays, ut2dmjd

Examples

Run this code
# NOT RUN {
# Ensure enough digits to see result, then return to previous value
dig <- getOption('digits')
options(digits=16)
ymd2jd(yr=2000, mo=1, dy=1)
ymd2jd(yr=2000, mo=1, dy=1.3)  # rounds to nearest day
options(digits=dig)
jd2ymd(ymd2jd(yr=2000, mo=1, dy=1))
# }

Run the code above in your browser using DataLab