You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rw...@apache.org on 2008/02/27 10:17:03 UTC

svn commit: r631518 - /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Author: rwinston
Date: Wed Feb 27 01:16:59 2008
New Revision: 631518

URL: http://svn.apache.org/viewvc?rev=631518&view=rev
Log:
Add timezone and date symbols to formatter (NET-188)

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=631518&r1=631517&r2=631518&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Wed Feb 27 01:16:59 2008
@@ -104,8 +104,10 @@
 				pp = new ParsePosition(0);
 				int year = Calendar.getInstance().get(Calendar.YEAR);
 				String timeStampStrPlusYear = timestampStr + " " + year;
-				SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy");
+				SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy", 
+						recentDateFormat.getDateFormatSymbols());
 				hackFormatter.setLenient(false);
+				hackFormatter.setTimeZone(recentDateFormat.getTimeZone());
 				parsed = hackFormatter.parse(timeStampStrPlusYear, pp);
 			}
 			if (parsed != null && pp.getIndex() == timestampStr.length() + 5) {