How to get a remote file's last modified time? I am using the following but it shows date with year 1970 only.
int mtime = entry.getAttrs().getMTime(); Date date = new Date (mtime);
When printed the date is "Mon Jan 19 09:09:10 IST 1970". What should be changed here to find the exact last modified time?
I was able to resolve this using the following
new Date((long)file.getAttrs().getMTime()*1000L)
where file is an instance of ChannelSftp.LsEntry
Log in to post a comment.
How to get a remote file's last modified time? I am using the following but it shows date with year 1970 only.
When printed the date is "Mon Jan 19 09:09:10 IST 1970". What should be changed here to find the exact last modified time?
I was able to resolve this using the following
where file is an instance of ChannelSftp.LsEntry