| jdn | R Documentation |
jdn computes the JDNs for dates or date-time indices and
jdn2tind returns dates or date-time indices given JDNs.
For date arguments jdn returns the numbers of days
since November 24, 4714 BC in the proleptic Gregorian calendar as
an integer vector. For date-time arguments day fraction in UTC is computed
and the return value is a numeric vector.
For integer arguments jdn2tind return tind of type
"d" (date), for non-integer arguments — tind of type
"t" (date-time). If tz argument is provided the return value
is always of type "t" (date-time).
jdn(x)
jdn2tind(x, tz = NULL)
x |
an object of |
tz |
(optional) a character value determining the time zone (the default
|
An integer or numeric vector for jdn, an object of tind class
(type "d" or "t") for jdn2tind.
For date-time indices JDN is computed based on day fraction since noon UTC and not midnight, so 0.5 offset will be observable.
date2num for conversion between dates and their
integer representations found different software packages.
# JDN of 2000-01-01 is 2451545
jdn("2000-01-01")
jdn2tind(2451545)
# JDN today, now?
jdn(today())
jdn(now())
# notice the .5 offset
jdn(today(tz = "UTC"))
format(jdn(as.date_time(today(tz = "UTC"), tz = "UTC")), digits = 8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.