is it possible to compute the birthdate of person using age??
can anyone help me on this..thanks....
calculate person's birthdate using age
Moderator: General Moderators
-
chelflores
- Forum Newbie
- Posts: 8
- Joined: Tue Jun 24, 2008 7:00 pm
Re: calculate person's birthdate using age
We can get one's birth year using his age. not birth day. But there might be some chances of error as well.chelflores wrote:is it possible to compute the birthdate of person using age??
can anyone help me on this..thanks....
For an example, I am 21. So, my birthday should be at 2009-21 = 1988 whereas, its in 1987.
Anyways, you can do this.
Code: Select all
$age = $_POST['age']; // Age of the user
$Time_Passed_Since_He_Was_Born = 60*60*24*365*$age; // Present time minus time since he was born. 60 sec * 60 min * 24 hrs * 365 days * his age.
$Year_Of_Birth = time() - $age;
echo date("Y", $Year_Of_Birth);