AlabamaHit Posted August 13, 2008 Posted August 13, 2008 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. Quote
Tonka Posted August 13, 2008 Posted August 13, 2008 Re: Time Stamp. 86400 is for one day just multiply this by 4 Quote
Floydian Posted August 13, 2008 Posted August 13, 2008 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. ;) Quote
Decepti0n Posted August 13, 2008 Posted August 13, 2008 Re: Time Stamp. if ($last_on > strtotime('-4 days')) { // do interest } Quote
Floydian Posted August 13, 2008 Posted August 13, 2008 Re: Time Stamp. lol that's a nice way to do it Quote
AlabamaHit Posted August 14, 2008 Author Posted August 14, 2008 Re: Time Stamp. Thank you all so much for your help :-D Quote
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.