Converts a date to DHS Century Month Code (CMC).

cmc_date(date)

Arguments

date

a Date vector

Value

an integer vector of CMC dates

Details

CMC date is defined as the number of months since 1900: $$cmc = (year - 1900) * 12 + momth$$

References

https://dhsprogram.com/Data/Guide-to-DHS-Statistics/Organization_of_DHS_Data.htm?rhtocid=_4_2_0#Structure_of_DHS_Databc-1

Examples

cmc_date(Sys.Date())
#> [1] 1499
cmc_date(as.Date("1987-02-11", format = "%Y-%m-%d"))
#> [1] 1046