Jump to content
MakeWebGames

Time Stamp.


AlabamaHit

Recommended Posts

Um....Hope I explain this good....Ok..here we go lol

I was wondering if someone could tell me what it the timestamp for 4 Days..

For example....if i didnt not want people who has not loggined in, in 4 days to get interest....(in there bank.)

Like what would the time stamp number be...

I also know for example 30 days would be like this...I only know because i found an example on here.

mysql_query("UPDATE users SET bank=bank+(bank/50) where bank>0 and time < (unix_timestamp()-2592000",$c);

but what would be the 4 days?

Or if you dont want to tell me thats fine..if you could point me to a place that explains how it works would be Great to..I kinda would like that better so I can learn it.

Link to comment
Share on other sites

Re: Time Stamp.

I normally write my time stamp deals like this:

 

$time = time();

$last_on = // value from database :)

if ($last_on > $time - 60 * 60 * 24 * 4) { // we're good to go } else { // we're not good to go }

 

where the amount subtracted from time follows this pattern:

 

second * minutes(opt) * hours(opt) * days(opt)

The second, third, and fourth parts of that equation are optional.

For 6 hours: 60 * 60 * 6

I do it this way because it makes the code much more readable.

;)

Link to comment
Share on other sites

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.   Paste as plain text instead

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