title: JAVA: get the creation date of a remote file via sftp
body: <p>Please I want to get the creation date of a remote file but I don't found a method that gives this option.
  I can get just the last modified date but i want to get the creation date of this file:</p>
  
  <p>here is my code:</p>
  
  <pre><code>import com.jcraft.jsch.Channel;
  import com.jcraft.jsch.ChannelSftp;
  import com.jcraft.jsch.JSch;
  import com.jcraft.jsch.JSchException;
  import com.jcraft.jsch.Session;
  import com.jcraft.jsch.SftpException;
  import java.text.DateFormat;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Calendar;
  import java.util.Date;
  
  public class mytest {
  
  
      public static void main(String args[]) throws ParseException {
  
          //===============================================================
          String hostname = "10.10.11.19";
          String username = "root";
          String password = "passwword";
          String remoteFile = "/opt/test_pyt/teeeeeeest.txt"
          String copyTo = "/home/desk/Desktop";
          JSch jsch = new JSch();
          Session session = null;
          System.out.println("Trying to connect.....");
          try {
              session = jsch.getSession(username, hostname, 22);
              session.setConfig("StrictHostKeyChecking", "no");
              session.setPassword(password);
              session.connect();
              Channel channel = session.openChannel("sftp");
              channel.connect();
              ChannelSftp sftpChannel = (ChannelSftp) channel;
              //get date of file=========================================   
              String lastModif = sftpChannel.lstat(remoteFile).getMtimeString();
  
              //I want to get creation date =============================
              creation_date= ???????????;
  
            //==============================================
                  sftpChannel.get(remoteFile, copyTo);
                  sftpChannel.exit();
                  session.disconnect();
  
  
          } catch (JSchException e) {
          } catch (SftpException e) {
          }
  
      }
  }
  </code></pre>
  
  <p>Thank you</p>