almightyegg Posted April 3, 2008 Share Posted April 3, 2008 I was wondering if somebody could point me in the right direction (either by starting the code/telling me the functions I need to use/sending me to a tutorial) for taking a timestamp and working out how many years, months, weeks, days, hours, minutes, seconds ago it was. Thanks in advance Quote Link to comment Share on other sites More sharing options...
tabatsoy Posted April 3, 2008 Share Posted April 3, 2008 you mean you want to echo the current time and day? Quote Link to comment Share on other sites More sharing options...
almightyegg Posted April 3, 2008 Author Share Posted April 3, 2008 no, I want to take the current timestamp and an old one that's saved and echo the years, months, weeks, days, hours, minutes and seconds since then Quote Link to comment Share on other sites More sharing options...
tabatsoy Posted April 3, 2008 Share Posted April 3, 2008 $timespan = $current - $savedtime; $timetotal = date("H:i:s m/d/Y"); echo $timetotal.'since last savedtime; try it! Quote Link to comment Share on other sites More sharing options...
almightyegg Posted April 3, 2008 Author Share Posted April 3, 2008 erm, that'll just show the current time Quote Link to comment Share on other sites More sharing options...
unsider Posted April 3, 2008 Share Posted April 3, 2008 $timespan = $current - $savedtime; $timetotal = date("H:i:s m/d/Y"); echo $timetotal.'since last savedtime; try it! This is incorrect. $current = insertYourDateFunction $savedtime = insertTimeStamp $timespan = $current - $savedtime; echo $timespan . 'since last savedtime'; Quote Link to comment Share on other sites More sharing options...
tabatsoy Posted April 3, 2008 Share Posted April 3, 2008 ok. 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.