Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.2k views
in Java FTP by
Hi,

I have a file listed with today date
-rwx---r-x 1 system System 10690 Oct 18 21:31 20041018163140.bin

When I call lastModified() method in the FTPFile it returns
10/18/2003 instead of 10/18/2004.

FTPFile[] remotefiles = ftpclient.dirDetails(".");
for(int i=0; i < remotefiles.length; i++)
{
FTPFile remotefile = remotefiles[i];
String filename = remotefile.getName();
Date date = remotefile.lastModified();
}

Output:
Processing file: [20041018163140.bin][10/18/2003 21:31:00]

13 Answers

0 votes
by
No i checked and made sure both the servers have the exact time. Is there a way to check the time on the servers.
0 votes
by
Hi, when I get the LastModified value on file where the server has filestamp is in the future compared to the client machine, the LastModified value has a year in the past.

Anyway way I can work around this ?
0 votes
by (161k points)
No. This is a bit tricky as a future date is used to figure out that it should be the previous year - which it normally is.

modtime() might be an option for you if your server supports it.

Hi, when I get the LastModified value on file where the server has filestamp is in the future compared to the client machine, the LastModified value has a year in the past.

Anyway way I can work around this ?

Categories

...