summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-27 07:47:14 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-27 07:47:14 +0000
commitad559b5c1cbaa50273c8063951a4e64a9f2c1fe7 (patch)
treef3079948dbc4ee6bfa3a99ae8db5d71ea3bbe5c3 /lib
parent9e4e7771662043a56f2588aff2d3263401bd0997 (diff)
merge revision(s) 56374: [Backport #12822]
* lib/logger.rb (Logger::Period#next_rotate_time): fix monthly log rotate when DST is applied during a month of 31 days. [Fix GH-1458] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@56504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/logger.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/logger.rb b/lib/logger.rb
index bd72bd7a78..09c8943c94 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -538,8 +538,8 @@ private
when /^weekly$/
t = Time.mktime(now.year, now.month, now.mday) + SiD * (7 - now.wday)
when /^monthly$/
- t = Time.mktime(now.year, now.month, 1) + SiD * 31
- mday = (1 if t.mday > 1)
+ t = Time.mktime(now.year, now.month, 1) + SiD * 32
+ mday = 1
else
return now
end