Joshua F Posted December 12, 2010 Share Posted December 12, 2010 I'm trying to make a code so that it will get the last date and timee it submitted into a database, but for this example I replaced the database loading with a default. I am trying to make it so that it will deisplay how long you must wait until you can vote again, which is every 24hours. $diffrence = strtotime('2010-12-11 10:59:59') - time(); return ("". number_format(($diffrence / 60 / 60), 2) ." hours"); So, lets say the time now is "2010-12-11 20:59:59". 10 hours have passed, so now you have 14 more hours. Quote Link to comment Share on other sites More sharing options...
requinix Posted December 12, 2010 Share Posted December 12, 2010 Okay. So what's the question? And for the future, a) Don't post the same question in two forums. b) Just because your code has numbers in it doesn't mean that it's a "math question". It's kinda figured that you, as a programmer, already have basic math skills. Quote Link to comment Share on other sites More sharing options...
Joshua F Posted December 12, 2010 Author Share Posted December 12, 2010 Okay. So what's the question? And for the future, a) Don't post the same question in two forums. b) Just because your code has numbers in it doesn't mean that it's a "math question". It's kinda figured that you, as a programmer, already have basic math skills. The question is that how would I make it figure how long until you can vote again. Also. a) I didn't mean to.. b) I know this, I didn't mean to. I'm sorry I miss clicked. 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.