commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35181] New: - FTP timestamp: year recognition
Date Thu, 02 Jun 2005 08:26:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35181>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35181

           Summary: FTP timestamp: year recognition
           Product: Commons
           Version: 1.4 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: ishigami@victokai.co.jp


org.apache.commons.net.ftp.parser.FTPTimestampParserImpl

public Calendar parseTimestamp(String timestampStr)
      :
    if (working.after(now)) {
        working.add(Calendar.YEAR, -1);
    }

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 --recognized as--> Jun/02/2004 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);
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message