Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.4
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
35181
Description
org.apache.commons.net.ftp.parser.FTPTimestampParserImpl
public Calendar parseTimestamp(String timestampStr)
:
if (working.after(now))
If system date of the remote machine is ahead of local machine, the code above
does not work well. For example, when the system date of local machine is five
minutes later than date of file at the remote machine, it is recognized as the
file a year ago.
LOCAL SYSDATE:Jun/02/2005 14:00
File TimeStamp
Jun/02 14:05 -
The date format is switched after six months, so I think that the code above
shuold be changed as following:
// s m h d half-year
// 1000*60*60*24*183=15811200000ms
long wkt = working.getTimeInMillis();
long nwt = now.getTimeInMillis();
if (wkt > (nwt+15811200000L)) { working.add(Calendar.YEAR, -1); }
Attachments
Issue Links
- relates to
-
NET-188 FTPClient#listFiles returns null element when file's timestamp is "02/29"
- Closed