Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 70551 invoked from network); 5 Feb 2009 22:16:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Feb 2009 22:16:24 -0000 Received: (qmail 83264 invoked by uid 500); 5 Feb 2009 22:16:22 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 83212 invoked by uid 500); 5 Feb 2009 22:16:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 83201 invoked by uid 99); 5 Feb 2009 22:16:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 14:16:22 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Feb 2009 22:16:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A0714234C48D for ; Thu, 5 Feb 2009 14:15:59 -0800 (PST) Message-ID: <1927587510.1233872159655.JavaMail.jira@brutus> Date: Thu, 5 Feb 2009 14:15:59 -0800 (PST) From: "Sebb (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (NET-253) How to get time values (hour, min, sec) using FileFTP.getTimestamp() method In-Reply-To: <1923180163.1233790619731.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/NET-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670921#action_12670921 ] Sebb commented on NET-253: -------------------------- Unix systems often use two different date formats, one with just the date (including the year) and the other with the time. For files that are more than a year old - as is the case in your example - no times are displayed. Try doing a "dir" of a more recent file and see what that gives. Unless the FTP server returns the infomation, there's nothing that NET can do. > 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 X2 WS_FTP Server 5.0.4 (2790816660) > USER > 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.