Calculate Date of Birth from Age

csharp India
  • 14 years ago

    Hello friends,

              I wanta code to find date of birth from Age in c#..

             Plz reply any one Know this code..






  • 14 years ago

    That is kind of a stupid question.
    If I tell you I am 26, there is no possible way to calculate my date of Birth.

    However, if I told you I was born on the 24th of April 2006. Then it stands to reason...
    2006 - 26 = 1980
    So I was born on the 24th of April 1980.

    Very simple concept really, My daughter can't program, but she could tell you how to have done that.


  • 14 years ago

    Hi Genious,

             Thanx for Ur Reply...

             i too know that ....

            plz ask u'r daughter abt my question...

         MY  age : 26 yrs 4 months 15 days 

       from that how to calculate my date of birth?


      Advance thax for u'r answer....



  • 14 years ago
    Get the current date, subtract 26 years, subtract 4 months, subtract 15 days.  There's you date of birth.  You would actually subtract 26 years by adding -26 years.

  • 14 years ago

    Hello, please dont insult other members, and I strongly believe calculating date of birth from age is not that perticularly unuseful. Although you cant know their exact dob, but what the result gives you is a date that is relative to today's date. eg. if today is Jan 11 2007, then if you want to find out people who is under 20 years old, you will subtract 20 years from it, so people who born after Jan 11 1987 will all be less than 20 years old... btw, you cant simply subtract the years, because this is just a simple example, since it also depends on the time, as well as the time zone, so is not that simple as you think.


Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match” - Bill Bryson