Learn R Programming

insol (version 1.2.2)

JD: Julian Day from POSIXct

Description

Computes Julian Day from dates as POSIXct object.

Usage

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

Value

Julian Day

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.

See Also

JDymd

Examples

Run this code
# NOT RUN {
JD(Sys.time())
JD(seq(ISOdate(2019,1,21),ISOdate(2019,12,21),by='month'))

# }

Run the code above in your browser using DataLab