Page 1 of 1

Time Difference Question

Posted: Sun Mar 18, 2007 11:16 am
by tecktalkcm0391
Ok, I have a timestamp of the time the user last changed pages. I have and AJAX script doing a check and I want the PHP page its going to do find the time difference between the current time and the last changed page time and if its greater than 20 minutes to run the Javascript Function. What would I do on the page the AJAX script checks?

Posted: Sun Mar 18, 2007 11:52 am
by bokehman
Convert last changed to a timestamp and test it against time();

Posted: Sun Mar 18, 2007 1:46 pm
by tecktalkcm0391
I mean like logic wise?

Code: Select all

if( Last Changed - Current Time < 5 mins ){

}
Cause I cant get that to work... :(

Posted: Sun Mar 18, 2007 2:23 pm
by feyd
Current time - Change time < X minutes.