Skip to content

Century in swedish personal identity number #964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 2.0
Choose a base branch
from

Conversation

jongotlin
Copy link

@jongotlin jongotlin commented May 8, 2025

What is the reason for this PR?

Sometimes you need the full identity number (with century). For example when working with Swedish Bank ID.

  • A new feature
  • Fixed an issue (resolve #ID)

Author's checklist

Review checklist

  • All checks have passed
  • Changes are added to the CHANGELOG.md
  • Changes are approved by maintainer

@chogberg
Copy link

chogberg commented May 15, 2025

I'm not sure if it matters, but the way to indicate which century a personal number format belongs to is a + sign. Most systems do not use this format, though. A person with a personal number 25XXXX+XXXX is born in 1925, and 25XXXX-XXXX is born in 2025. This is stated in §18 in folkbokföringslagen. I have no clue how that will sort 21XX, but maybe they did not think it would last that far.

Edit: After a quick re-read, it is stated that if it is not cumbersome, the year should be stored with 4 digits. This is an amendment to the law which was enacted in 2009. Since the + format is stated above and still valid, the amendment just adds that the format for digits should be stored if not cumbersome seems to be 1925XXX+XXXX, which I have never seen someone use.

https://www4.skatteverket.se/rattsligvagledning/28831.html?date=2025-01-01

@jongotlin
Copy link
Author

I haven't seen any implementation using +-. Plus sign doesn't indicate century but if the person is 100+ years old. Sure it can be added as an optional parameter here but since no one is using it lets wait until it's requested.

@chogberg
Copy link

I haven't seen any implementation using +-. Plus sign doesn't indicate century but if the person is 100+ years old. Sure it can be added as an optional parameter here but since no one is using it lets wait until it's requested.

Sounds great to wait. I have not seen the +/- sign usage either, and, strangely, it seems to be kept even when (since the law does not say otherwise) four digits are used for the year. Sure, the +/- is not used explicitly for century, but the effect is that it differentiates between the current century and the former century, or as you say, that the person is 100 or more years old

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants