date_fix_century: Assign date to 1900s or 2000s correctly.

View source: R/date_fix_century.R

date_fix_centuryR Documentation

Assign date to 1900s or 2000s correctly.

Description

# fix year by assigning a date (date_ymd) above the cutoff date (cut_date_ymd) to the 1900s or below to the 2000s.

Usage

date_fix_century(
  date_ymd = lubridate::ymd("2020-03-26"),
  cut_date_ymd = lubridate::ymd(Sys.Date())
)

Arguments

date_ymd

Date to check. YMD format ("2020-03-26").

cut_date_ymd

Optional. Date to check against. YMD format ("2020-03-26"). Defaults to current system date.

Examples

date_fix_century("2049-11-30")
[1] "1949-11-30"

uva-bi-sdad/dc.utils documentation built on Aug. 1, 2022, 1:45 a.m.