Age in years with decimal precision given a datetime

前端 未结 6 1949
-上瘾入骨i
-上瘾入骨i 2021-01-06 03:37

How can I get the age of someone given the date of birth in a C# datetime.

I want a precise age like 40.69 years old

6条回答
  •  梦毁少年i
    2021-01-06 04:11

    how much error is allowed in the fractional portion? a precise age would be

    31 years, 10 days, 3 hours, etc. depending on the precision wanted.

提交回复
热议问题