07-16-2010, 05:32 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Feb 2007
Posts: 64
Thanks: 9
|
Difference between timestamps
I know, this should be an incredibly easy task but for some reason I just cannot get it to work properly.
I have a comment form that needs to check a users last post time to the current, and see if at least 30 seconds have passed before allowing them to post again.
The users last post is stored as datetime (Y d m H i s), and the current time is generated as time().
I am converting the users datetime with strtotime, and checked that it worked by using a timestamp converter.
How would I gather a 30 second time difference between the two? I've been trying to add 30 to the users time, which is obviously wrong because when I print that back out, I get a timestamp for something like January of 2051 :(
If anyone can help, I would much appreciate it!
|
|
|
|