Add when() function

this function is used to check the modified date of a file or folder