ruby-changes:39756
From: shugo <ko1@a...>
Date: Sat, 12 Sep 2015 18:03:58 +0900 (JST)
Subject: [ruby-changes:39756] shugo:r51837 (trunk): * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "00:00" to
shugo 2015-09-12 18:03:44 +0900 (Sat, 12 Sep 2015) New Revision: 51837 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51837 Log: * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "00:00" to get UTC time. Thanks, Wilson Bilkovich. Modified files: trunk/ChangeLog trunk/lib/net/ftp.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 51836) +++ ChangeLog (revision 51837) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Sep 12 18:00:35 2015 Shugo Maeda <shugo@r...> + + * 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@r...> * lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSD Index: lib/net/ftp.rb =================================================================== --- lib/net/ftp.rb (revision 51836) +++ lib/net/ftp.rb (revision 51837) @@ -774,8 +774,7 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/ftp.rb#L774 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/