---
title: "age calculation in C#"  
description: "age calculation in C#"  
author: "benjamin richards"  
published: 2013-02-04  
updated: 2013-02-04  
canonical: https://www.mindstick.com/forum/577/age-calculation-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# age calculation in C#

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances)!

I'm working on [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) with C# and I want to calculate [age](https://www.mindstick.com/articles/23262/the-modern-age-these-technology-trends-can-make-your-life-easier) (year) from today's date. Please help me!

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by AVADHESH PATEL

Hi Benjamin Richards!

You can use this way!

// Get current date\
DateTime today = DateTime.Today;\
// Assing given date\
DateTime bday = DateTime.Parse("12/05/1986 12:00:00 AM");\
// Get difference between two date\
int age = today.Year - bday.Year;


---

Original Source: https://www.mindstick.com/forum/577/age-calculation-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
