summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/net/ftp.rb3
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f4baea53a..783e3b3378 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 12 18:00:35 2015 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "+00:00" to
+ get UTC time. Thanks, Wilson Bilkovich.
+
Sat Sep 12 17:55:24 2015 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSD
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index b70414eb2b..8bd309b21a 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -774,8 +774,7 @@ module Net
CASE_INDEPENDENT_PARSER = ->(value) { value.downcase }
INTEGER_PARSER = ->(value) { value.to_i }
TIME_PARSER = ->(value) {
- t = Time.strptime(value.sub(/\.\d+\z/, "") + "+00:00",
- "%Y%m%d%H%M%S%z").utc
+ t = Time.strptime(value.sub(/\.\d+\z/, "") + "Z", "%Y%m%d%H%M%S%z")
fractions = value.slice(/\.(\d+)\z/, 1)
if fractions
t + fractions.to_i.quo(10 ** fractions.size)