summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-17 17:38:53 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-17 17:38:53 +0000
commit7c0c4c8e5e842d355b61cf9afc5cd6e838718b64 (patch)
tree42e551d18fa25e306dc6dea8d908913dfd48f5d4 /lib
parent55f7a78ca3ba9e1fe679bd678ff43f54ff9d475b (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_3@56438 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 5a310bacb5..259d4692b1 100644
--- a/lib/logger.rb
+++ b/lib/logger.rb
@@ -593,8 +593,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
- return Time.mktime(t.year, t.month, 1) if t.mday > 1
+ t = Time.mktime(now.year, now.month, 1) + SiD * 32
+ return Time.mktime(t.year, t.month, 1)
else
return now
end