rofl90 Posted April 7, 2008 Share Posted April 7, 2008 I'm guessing this is VERY easy here we go: My code gets the birthday in a timestamp from a database which is $core->profile("birthday", $id) $id being the users id.. heres my code $time_y = time() - $core->profile("birthday", $id); echo date("Y", $time_y); it echo's 1984 Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 7, 2008 Share Posted April 7, 2008 Try this: <?php $time_y = time() - $core->profile("birthday", $id); echo date("Y", strtotime($time_y)); ?> Quote Link to comment Share on other sites More sharing options...
rofl90 Posted April 7, 2008 Author Share Posted April 7, 2008 that gives 1969 Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 7, 2008 Share Posted April 7, 2008 What do you get if you echo out $time_y? Edit: Also, what is the date supposed to be? Quote Link to comment Share on other sites More sharing options...
rofl90 Posted April 7, 2008 Author Share Posted April 7, 2008 time_y echos 456009783 The timestamp should be about the 26th october 1993, my birthday =) Quote Link to comment Share on other sites More sharing options...
Barand Posted April 7, 2008 Share Posted April 7, 2008 timestamp value for 26 Oct 1993 is 751593600 yours (456009783) is for 1984-06-13 22:23:03 <?php echo date('Y-m-d H:i:s', 751593600); // 1993-10-26 00:00:00 echo date('Y-m-d H:i:s', 456009783); // 1984-06-13 22:23:03 ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.