diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-12 09:03:44 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-12 09:03:44 +0000 |
commit | 891d7451e60095665e0d619cfdaea6cc45c641fb (patch) | |
tree | e26ad77aa8258fca511fd506ad537eeabe3e3557 /lib/net | |
parent | cf67b934e911b3fb2497589293075db3accd7678 (diff) | |
download | ruby-891d7451e60095665e0d619cfdaea6cc45c641fb.tar.gz |
* lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "00:00" to
get UTC time. Thanks, Wilson Bilkovich.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/ftp.rb | 3 |
1 files changed, 1 insertions, 2 deletions
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) |