R/convert_to_mjd_2.R

Defines functions convert_to_mjd_2

convert_to_mjd_2 <- function(vec_date) {
  dt <- as.POSIXct(vec_date, format = "%y%b%d", tz = "UTC")
  # Calculate Julian Date
  jd <- as.numeric(dt) / 86400 + 2440587.5

  # Calculate Modified Julian Date
  mjd <- jd - 2400000.5
  return(mjd)
}

Try the gmwmx2 package in your browser

Any scripts or data that you put into this service are public.

gmwmx2 documentation built on Aug. 21, 2025, 5:56 p.m.