mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
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
This commit is contained in:
parent
55f7a78ca3
commit
7c0c4c8e5e
4 changed files with 99 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue