(Please use a more descriptive title for your questions)
In pseudocode, your solution would be something like this:
- Get date two weeks ago (using time and some basic arithmatic to subtract 14 day's worth of seconds)
- Open directory handle with opendir
- For each file read from the directory handle with readdir...
- Ignore file unless is starts with DATE_ (check with a regular expression)
- Parse date and time out of filename (using a regex)
- If parsed date is less than the two week's ago date that you calculated at the start then delete the file
- Read next file from directory handle