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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.