Function parseSocialSecurityNumberDK

  • Extract birthdate (yyyy,mm,dd), four digit id and sex from a Danish social security number. Assumes birth dates are at most 100 years in the past.

    Parameters

    • ssn: string

      Danish social security number

    Returns ParsedSocialSecurityNumberDK | undefined

    An object containing the birth year, month, day, id, and sex of the individual.

    Throws

    Will throw an error if the SSN is not a valid Danish Social Security Number.

    Example

    const ssn = '010203-1234'
    parseSocialSecurityNumberDK(ssn)
    //=> { year: 2003, month: 2, day: 1, id: 1234, sex: 'F' }

Generated using TypeDoc