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/03/09 18:32:08 UTC
svn commit: r635305 -
/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
Author: rwinston
Date: Sun Mar 9 10:31:56 2008
New Revision: 635305
URL: http://svn.apache.org/viewvc?rev=635305&view=rev
Log:
NET-198
Modified:
commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
Modified: commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=635305&r1=635304&r2=635305&view=diff
==============================================================================
--- commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original)
+++ commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Sun Mar 9 10:31:56 2008
@@ -74,7 +74,6 @@
*/
public Calendar parseTimestamp(String timestampStr) throws ParseException {
Calendar now = Calendar.getInstance();
- now.setTimeZone(this.getServerTimeZone());
return parseTimestamp(timestampStr, now);
}
@@ -93,7 +92,8 @@
* @param now The current time
*/
public Calendar parseTimestamp(String timestampStr, Calendar now) throws ParseException {
- Calendar working = Calendar.getInstance();
+ now.setTimeZone(this.getServerTimeZone());
+ Calendar working = (Calendar) now.clone();;
working.setTimeZone(getServerTimeZone());
ParsePosition pp = new ParsePosition(0);
@@ -122,7 +122,7 @@
// This is pretty bad hack to work around the deficiencies of the JDK date/time classes.
if (recentDateFormat != null) {
pp = new ParsePosition(0);
- int year = Calendar.getInstance().get(Calendar.YEAR);
+ int year = now.get(Calendar.YEAR);
String timeStampStrPlusYear = timestampStr + " " + year;
SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy",
recentDateFormat.getDateFormatSymbols());