---
title: "How do I calculate someone's age"  
description: "How do I calculate someone's age"  
author: "Anonymous User"  
published: 2013-05-29  
updated: 2013-05-29  
canonical: https://www.mindstick.com/forum/934/how-do-i-calculate-someone-s-age  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How do I calculate someone's age

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!\
Given a [DateTime](https://www.mindstick.com/forum/12949/how-to-validate-if-a-datetime-field-is-not-null-empty) representing a person's birthday, how do I calculate their [age](https://www.mindstick.com/articles/23262/the-modern-age-these-technology-trends-can-make-your-life-easier)?\
Thanks in advance.

## Replies

### Reply by AVADHESH PATEL

Hi Jeet!\
For some reason Jeff's code didn't seem simple enough. To me this seems simpler and easier to understand:\
DateTime today = DateTime.Today;int age = today.Year - bday.Year;if (bday > today.AddYears(-age)) age--;


---

Original Source: https://www.mindstick.com/forum/934/how-do-i-calculate-someone-s-age

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
