jday: Calculates the astronomical Julian day

View source: R/solar.R

jdayR Documentation

Calculates the astronomical Julian day

Description

jday is used to calculate the astronomical Julian day (days since since January 1, 4713 BCE at noon UTC) from a given year, month and day.

Usage

jday(year, month, day, hour = 12, min = 0, sec = 0, dst = 0, tme = NA)

Arguments

year

year (AD).

month

month in numeric form (1-12).

day

days of the month (1-31).

hour

hours (decimal, 0-23).

min

minutes (decimal, 0-59).

sec

seconds (decimal, 0-59).

dst

an optional numeric value specifying the time zone expressed as hours different from GMT (-ve to west).

tme

POSIXlt object of times in UTC. Other inputs ignored if this is provided

Value

Julian Day. I.e. the number of days since January 1, 4713 BCE at noon UTC.

Examples

tme <- as.POSIXlt(0, origin = "2020-03-21 12:43", tz = "UTC")
jday(tme = tme)
jd1 <- jday(2010, 1, 31)
jd2 <- jday(2010, 1, 31, 11, 0, 0)
jd1 - jd2

ilyamaclean/microctools documentation built on Jan. 25, 2023, 5:29 a.m.