Skip to contents

Convert Julian Date values back to regular date-time values.

Usage

jd_to_datetime(jd, tz = "UTC")

Arguments

jd

Numeric vector of Julian Date values.

tz

Time zone for output `POSIXct` values.

Value

`POSIXct` vector.

Details

`tz` changes only how time is displayed, not the physical moment.

Uses ERFA with `scale = "UTC"`. Leap seconds are handled by ERFA.

Examples

jd <- 2461107.5
jd_to_datetime(jd, tz = "UTC")
#> [1] "2026-03-08 UTC"
jd_to_datetime(jd, tz = "Europe/Moscow")
#> [1] "2026-03-08 MSK"

x <- as.POSIXct("2026-03-08 00:00:00", tz = "UTC")
jd_to_datetime(datetime_to_jd(x), tz = "UTC")
#> [1] "2026-03-08 UTC"