Skip to contents

Create a Julian date object.

Usage

julian(year = integer(), month = integer(), day = integer())

as_julian(date, ...)

Arguments

year

A numeric vector of years

month

A numeric vector of months

day

A numeric vector of days

date

Vector of dates on some calendar

...

Additional arguments not currently used

Value

A julian vector object

Examples

julian(2025, 4, 19:30)
#> <julian[12]>
#>  [1] 2025-04-19 2025-04-20 2025-04-21 2025-04-22 2025-04-23 2025-04-24
#>  [7] 2025-04-25 2025-04-26 2025-04-27 2025-04-28 2025-04-29 2025-04-30
as_julian("2016-01-01")
#> <julian[1]>
#> [1] 2015-12-19
as_julian(Sys.Date())
#> <julian[1]>
#> [1] 2025-04-21
tibble::tibble(
  x = seq(as.Date("2025-01-01"), as.Date("2025-12-31"), by = "day"),
  y = as_gregorian(x),
  z = as_julian(x)
)
#> # A tibble: 365 × 3
#>    x                   y          z
#>    <date>          <Gre>      <Jul>
#>  1 2025-01-01 2025-01-01 2024-12-19
#>  2 2025-01-02 2025-01-02 2024-12-20
#>  3 2025-01-03 2025-01-03 2024-12-21
#>  4 2025-01-04 2025-01-04 2024-12-22
#>  5 2025-01-05 2025-01-05 2024-12-23
#>  6 2025-01-06 2025-01-06 2024-12-24
#>  7 2025-01-07 2025-01-07 2024-12-25
#>  8 2025-01-08 2025-01-08 2024-12-26
#>  9 2025-01-09 2025-01-09 2024-12-27
#> 10 2025-01-10 2025-01-10 2024-12-28
#> # ℹ 355 more rows