Reputation: 1879
I want to delete the files which were created today. So how I could do this?
Upvotes: 1
Views: 721
Reputation: 6972
File f = new File("somefile.txt");
if(f.lastModified() > DAY_START && f.lastModified() < DAY_END){
f.delete();
}
WHERE
DAY_START - long value of day start time
DAY_END - long value of day end time
HOPE it help you!!!
Upvotes: 1