Jump to content

Time Remaining


Joshua F

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/221361-time-remaining/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/221361-time-remaining/#findComment-1146001
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/221361-time-remaining/#findComment-1146004
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.