Hello, I am trying to compare the LAST MODIFIED dates of some folders my application is viewing, and I only want to display the folders that were last modified TODAY. Here is what I have so far
-------------------------
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%
File dir = new File("/DATA/tomcat4/webapps/tf/DICOM");
//the DICOM folder has a bunch of folders in it
String[] files = dir.list();
for (int i = 0; i < files.length; i++) {
String thepath = dir.getPath();
thepath = thepath + "/";
thepath = thepath + files[i];
File f = new File(thepath);
String newpath = f.getPath();
out.print("<BR>" + newpath + "<BR>");
long lastmod = f.lastModified();
out.print("Epoch time last modified: " + lastmod);
java.util.Date d = new java.util.Date(lastmod);
out.print("<BR>Date last modified: " + d + "<BR>");
thepath = "";
}
%>
----------------------------------------
it ouputs something like this:
/DATA/tomcat4/webapps/tf/DICOM/1689236
Epoch time last modified: 1063043798000
Mon Sep 08 11:56:38 MDT 2003
/DATA/tomcat4/webapps/tf/DICOM/1662170
Epoch time last modified: 1063121523000
Tue Sep 09 09:32:03 MDT 2003
/DATA/tomcat4/webapps/tf/DICOM/1111111
Epoch time last modified: 1062774534000
Fri Sep 05 09:08:54 MDT 2003
-------------------------------------------
But I really only want to show the one in the middle that was last modified today.
Any ideas?