本帖最后由 pchao333 于 2011-03-02 17:47:29 编辑

解决方案 »

  1.   

    这个返回值很诡异,难道只能靠截取其中的一部分:
    getModificationTime(Path).split(" ")[1].split("\\.")[0])
    然后再转?
      

  2.   

    刚又换了台ftp服务器做了下试验,得到的结果为:“213 20100719065946”
    没有了小数点,但前面的“213”加空格依然存在。可以肯定后14位为“YYYYMMDDhhmmss”格式。现在的问题是,在不同的FTP服务器上得到的格式会不会有很大差别?
      

  3.   

    看看javadoc说明:
    getModificationTime
    Issue the FTP MDTM command (not supported by all servers to retrieve the last modification time of a file. The modification string should be in the ISO 3077 form "YYYYMMDDhhmmss(.xxx)?". The timestamp represented should also be in GMT, but not all FTP servers honour this.