MortimerJazz Posted January 15, 2007 Share Posted January 15, 2007 I'm trying to calculate the number of hours/days/weeks since a particular user has logged into the website.Here's what I've got so far. The last_login variable comes from the database.[code]$current=gmdate('d-m-Y H:i');$last_login=date("m/d/Y", strtotime($last_login));$difference=$current-$last_login;echo "Seller last login: $difference";}[/code]Unfortunately, that doesn't seem to be working. All I'm getting is a big fat "0" being printed on the screen.Can someone tell me where I'm going wrong? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted January 16, 2007 Share Posted January 16, 2007 This might help you out: http://viplyrics.com/tzfiles/phpcode/age_calculator.php <- it calculates years, you may need to modify it though, it also starts with the example first 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.