diff --git a/Personnummer/Personnummer.cs b/Personnummer/Personnummer.cs index af4689c..31230c3 100644 --- a/Personnummer/Personnummer.cs +++ b/Personnummer/Personnummer.cs @@ -24,7 +24,15 @@ public Options() public DateTime Date { get; private set; } - public int Age => DateTime.Now.Year - Date.Year; + public int Age + { + get + { + var now = DateTime.Now; + var differenceInTotalMonth = 12 * (now.Year - Date.Year) + now.Month - Date.Month; + return differenceInTotalMonth / 12; + } + } public string Separator => Age >= 100 ? "+" : "-";