Skip to contents

For easy calculation. Does not handle cprs with letters (interim cpr)

Usage

cpr_dob(cpr)

Arguments

cpr

cpr-numbers as ddmmyy"-."xxxx or ddmmyyxxxx. Also mixed formatting. Vector or data frame column.

Value

vector of Date elements. Format yyyy-mm-dd

Examples

cpr_dob("231045-0637")
#> [1] "1945-10-23"
fsd<-c("2310450637", "010190-2000", "010115-4000","300450-1030","010150-4021")
cpr_dob(fsd)
#> [1] "1945-10-23" "1990-01-01" "2015-01-01" "1950-04-30" "1950-01-01"