Oct 012011
 

Just today while driving back home, a random question came across my mind,

What is my age in number days?

Now, I am not good at maths to figure it out manually but since I am decent php programmer, I wrote this small code snippet which helps calculate my age counting in terms days. And its just one line!

$birthday = '1989-03-06';
$now = date("Y-m-d");
echo 'You are '. date_diff(date_create($birthday), date_create($now))->format('%a days old');

So according to this,
Today is the 8,244th day of my life. Cheers! :D

 

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>