0

I have a loop over files. So the file can be accessed with $f. I'd like to know if the file was created after a certain date and time

for example let's pick a time : 2015-05-22 and 14:11:00 I'd like to know if the file was created after that time

I know this is a way to find them How to use 'find' to search for files created on a specific date? but I want to check a file I'm looking instead. I'm already in a loop over all files. Also I need to check day and time.

Community
  • 1
  • 1
Cher
  • 2,789
  • 10
  • 37
  • 64
  • I'm assuming by `$f` you are using PHP. If you have the file name, have you looked into using the `filetime()` function? Documentation here: http://php.net/manual/en/function.filemtime.php – Ye. May 22 '15 at 18:17

1 Answers1

0

I did it in a different way following this post :

Bash: delete based on file date stamp

I create the dummyfile at current date, then I execute my code, and after I compare the date with the dummy file as in the link explains

Community
  • 1
  • 1
Cher
  • 2,789
  • 10
  • 37
  • 64