for the code
ftp.chdir(ftp.pwd()+"/softwares");
Timestamp ts = new Timestamp (ftp.modtime "README_Postgres.txt").getTime());
System.out.println(ts.toString());
FTPFile s[] = ftp.dirDetails(".");
for (int i=0;i<s.length;i++)
{
System.out.println(s[i].getName());
System.out.println(s[i].lastModified().toString());
}
Console Output is
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.916 : 230 Login successful. Have fun.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.916 : ---> PWD
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.976 : 257 "/home"
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.976 : ---> CWD /home/softwares
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.986 : 250 Directory successfully changed.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.986 : ---> MDTM README_Postgres.txt
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.986 : 213 20040720094039
2004-07-20 15:10:39.0 <---(Value from modTime() )
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:30.996 : ---> SYST
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:31.6 : 215 UNIX Type: L8
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:31.6 : ---> PASV
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:31.26 : 227 Entering Passive Mode (172,20,13,173,50,142)
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:31.26 : ---> LIST .
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:31.26 : 150 Here comes the directory listing.
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 21 Jul 2004 12:53:31.36 : 226 Directory send OK.
README_Postgres.txt
Tue Jul 20 09:40:00 GMT+05:30 2004 <-- (Value from dirDetails)
why am i getting 2 different dates for modification time of README_Postgres.txt file..
am i doing something wrong in the code...
plz help