JD: Julian Day from POSIXct

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/JD.R

Description

Computes Julian Day from dates as POSIXct object.

Usage

1
JD(x, inverse=FALSE)

Arguments

x

POSIXct object.

inverse

Logical. If false (default) returns the Julian Days corresponding to given dates. If TRUE returns the date corresponding to input Julian days

Details

Class "POSIXct" represents the (signed) number of seconds since the beginning of 1970 (in the UTC timezone) as a numeric vector, and Julian Day is the number of days since January 1, 4713 BCE at noon UTC, so the Julian Day is calculated as numeric(POSIXct)+2440587.5 days.

Value

Julian Day

Note

You may like to double check the results here:
https://ssd.jpl.nasa.gov/tc.cgi

To get correct values it is recommended to increase the number of digits to display: options(digits=12)

Author(s)

Javier G. Corripio

See Also

JDymd

Examples

1
2
JD(Sys.time())
JD(seq(ISOdate(2019,1,21),ISOdate(2019,12,21),by='month'))

insol documentation built on Feb. 10, 2021, 5:08 p.m.