[ 
https://issues.apache.org/jira/browse/NET-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670870#action_12670870
 ] 

Jignesh Patel commented on NET-253:
-----------------------------------

Well Sebb, below is output of different commands (ls, ls -l, dir) I have used:
------------------------
ftp> ls
200 command successful
150 Opening ASCII data connection for directory listing
267819657.end
267819657.zip
267819718.end
267819718.zip
331519726.end
331519726.zip
226 transfer complete
ftp: 90 bytes received in 0.00Seconds 22.50Kbytes/sec.
ftp>
ftp> ls -l
200 command successful
150 Opening ASCII data connection for directory listing
267819657.end
267819657.zip
267819718.end
267819718.zip
331519726.end
331519726.zip
226 transfer complete
ftp: 90 bytes received in 0.00Seconds 45.00Kbytes/sec.
ftp>
ftp> dir
200 command successful
150 Opening ASCII data connection for directory listing
drwxr-xrwx  2 system   System            0 Dec 24  2007 .
drwxr-xrwx  2 system   System            0 Dec 24  2007 ..
-rwxr-xrwx  1 system   System            0 Mar 26  2007 267819657.end
-rwxr-xrwx  1 system   System        86900 Mar 26  2007 267819657.zip
-rwxr-xrwx  1 system   System            0 Mar 26  2007 267819718.end
-rwxr-xrwx  1 system   System        69415 Mar 26  2007 267819718.zip
-rwxr-xrwx  1 system   System            0 Mar 26  2007 331519726.end
-rwxr-xrwx  1 system   System       103561 Mar 26  2007 331519726.zip
226 transfer complete
ftp: 545 bytes received in 0.00Seconds 136.25Kbytes/sec.
ftp>
------------------------------

If there is no way to get time details using getTimestamp() method, I will try 
to use getModificationTime() method of FTPClient class.

Thanks anyways.

Regards,
Jignesh

> How to get time values (hour, min, sec) using FileFTP.getTimestamp() method
> ---------------------------------------------------------------------------
>
>                 Key: NET-253
>                 URL: https://issues.apache.org/jira/browse/NET-253
>             Project: Commons Net
>          Issue Type: Task
>    Affects Versions: 2.0
>         Environment: Windows Vista Business, java version "1.6.0_11"
>            Reporter: Jignesh Patel
>
> Hello,
> I am using commons-net-2.0 in my application to access FTP server.
> My aim is to get value of "last modified date/time" value for any file 
> present on FTP Server.
> The FTP Server resides at different location and I don't have direct access 
> to it.
> Beloew are some lines I can see when I connect to FTP Server using ftp client 
> software.
> 220 <server-name> X2 WS_FTP Server 5.0.4 (2790816660)  
> USER <userid>  
> 331 Password required  
> PASS **********  
> 230 user logged in  
> SYST  
> 215 UNIX
> Though it was listed "UNIX", I confirmed with my team that actual operating 
> system on FTP Server is Windows 2000.
> To achieve my aim, I used getTimestamp() method of FileFTP class.
> I have used default settings. Even I have not configured FTP server using 
> FTPClientConfig.
> The problem is - the Calendar object returned by invoking getTimestamp() 
> method only contains correct date (day, month & year) value. It does not 
> contain time parts (hour, min, sec, etc.). When I tried to print date in 
> yyyy-MM-dd HH:mm:ss format, it printed zeros for HH, mm & ss parts (e.g. 
> 2007-03-26 00:00:00). Any idea on how to get date value value along with time 
> parts? Am I missing some other configurations?
> Note: If above option fails, I may plan to use getModificationTime() method 
> of FTPClient class.
> Thank you,
> Jignesh

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to