I wish to be able to check whether a file is older than 5mins old.
Basically I have a webcam that uploads a screenshot every 30seconds called webcam.jpg and i want to know whether that file is older than 5mins old (ie. the webcam is off). How would i go about doing this?
Thankyou,
Jamie
filemtime function will do it
RW
=========================================== http://badblue.com Small footprint P2P web server for Windows,
I found that, but i still dont know exactly how i would code it. How do i compare the filemtime date/time with the current date/time -5mins?
filemtime(string) returns a UNIX timestamp, so does time()
These are in seconds.
5 mins is 5 * 60 = 300 seconds.
diff = time() - filemtime('webcam.jpg');
if (diff > 300) { // do something }