1 Reply Latest reply: Apr 6, 2007 1:53 PM by 807599 RSS

    FTP file timestamp/Calendar getTimeInMiilis() off by one year...

    807599
      Hi,

      My apologies if this doesn't belong here, but I'm not sure where to file it. I'm using the Apache commons library to do FTP transfers. When I pull a file down, I try to set the last-modified timestamp using:
      private static void setTimeStamp(FTPFile file, File localFile) {
        localFile.setLastModified(file.getTimestamp().getTimeInMillis());
      }
      However, it seems to be setting the timestamp incorrectly; the year is off by one.

      I can compensate for it by adding one to the calendar object, but I wanted to ask here to see if anyone can explain it to me in more detail... perhaps I am misunderstanding something fundamental about the Calendar class or something?

      Thanks,
      KaJun