#25 Invalid date

open
nobody
None
8
2006-10-19
2006-10-19
Pavel Krupets
No

This is the date I got (for all dirs and files). Year
is invalid:

drw------- 1 no-user no-group 0 Aug 31 15:15 .

jsch 0.1.29
executed agains Windows XP + WinSSHD

Please help! Maybe an advice? Please!

Discussion

  • Pavel Krupets
    Pavel Krupets
    2006-10-19

    • priority: 5 --> 8
     
  • Pavel Krupets
    Pavel Krupets
    2006-10-19

    Logged In: YES
    user_id=1007725

    WinSSHD 4.2

     
  • Pavel Krupets
    Pavel Krupets
    2006-10-19

    Logged In: YES
    user_id=1007725

    Tried to get file details using FileZilla. It showed correct
    value. :(

     
  • Gamov
    Gamov
    2008-03-06

    Logged In: YES
    user_id=1077046
    Originator: NO

    As for everything, you have to look in the source code to understand what's going on. That's a pity that such a nice library has no documentation... :o(

    Class com.jcraft.jsch.SftpATTRS needs to be fixed.

    The following code is wrong because of locale issue:
    public String getAtimeString(){
    SimpleDateFormat locale=new SimpleDateFormat();
    return (locale.format(new Date(atime)));
    }
    it must be replaced by:
    public String getAtimeString(){
    Date date= new Date(((long)atime)*1000);
    return (date.toString());
    }

    As you can see, the ATime (creation time) and MTime (mod date) are not in milisecs but in secs from midnight, January 1, 1970 UTC.

    Would be nice to also have the following methods added to the class:
    public Date getADate();
    public Date getMDate();

    Best Regards,
    Gam