Skip to content

Commit ed01f3c

Browse files
committed
Revert r54694 because of compatibility problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@54702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent bb7fa59 commit ed01f3c

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

ChangeLog

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ Fri Apr 22 18:22:15 2016 NARUSE, Yui <naruse@ruby-lang.org>
3333
* ext/nkf/nkf-utf8/nkf.c: Merge upstream 4f3edf80a0.
3434
patched by Anton Sivakov [Bug #12201] [Bug #12202]
3535

36-
Fri Apr 22 18:19:32 2016 Naotoshi Seo <sonots@gmail.com>
37-
38-
* ext/date/date_core.c (datetime_to_time): preserve timezone info
39-
[Bug #12189] [Fix GH-1295]
40-
4136
Fri Apr 22 18:16:51 2016 NARUSE, Yui <naruse@ruby-lang.org>
4237

4338
* lib/securerandom.rb (gen_random): to avoid blocking on Windows.

ext/date/date_core.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8581,24 +8581,21 @@ date_to_datetime(VALUE self)
85818581
static VALUE
85828582
datetime_to_time(VALUE self)
85838583
{
8584-
volatile VALUE dup = dup_obj(self);
8584+
volatile VALUE dup = dup_obj_with_new_offset(self, 0);
85858585
{
85868586
VALUE t;
85878587

85888588
get_d1(dup);
85898589

8590-
t = rb_funcall(rb_cTime,
8591-
rb_intern("new"),
8592-
7,
8590+
t = f_utc6(rb_cTime,
85938591
m_real_year(dat),
85948592
INT2FIX(m_mon(dat)),
85958593
INT2FIX(m_mday(dat)),
85968594
INT2FIX(m_hour(dat)),
85978595
INT2FIX(m_min(dat)),
85988596
f_add(INT2FIX(m_sec(dat)),
8599-
m_sf_in_sec(dat)),
8600-
INT2FIX(m_of(dat)));
8601-
return t;
8597+
m_sf_in_sec(dat)));
8598+
return f_getlocal(t);
86028599
}
86038600
}
86048601

test/date/test_date_conv.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ def test_to_time__from_date
3131
end
3232

3333
def test_to_time__from_datetime
34-
d = DateTime.new(2004, 9, 19, 1, 2, 3, 8.to_r/24) + 456789.to_r/86400000000
34+
d = DateTime.new(2004, 9, 19, 1, 2, 3, 9.to_r/24) + 456789.to_r/86400000000
3535
t = d.to_time
36-
assert_equal([2004, 9, 19, 1, 2, 3, 456789, 8*60*60],
37-
[t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec, t.utc_offset])
36+
if t.utc_offset == 9*60*60
37+
assert_equal([2004, 9, 19, 1, 2, 3, 456789],
38+
[t.year, t.mon, t.mday, t.hour, t.min, t.sec, t.usec])
39+
end
3840

3941
d = DateTime.new(2004, 9, 19, 1, 2, 3, 0) + 456789.to_r/86400000000
4042
t = d.to_time.utc

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.2.5"
22
#define RUBY_RELEASE_DATE "2016-04-22"
3-
#define RUBY_PATCHLEVEL 313
3+
#define RUBY_PATCHLEVEL 314
44

55
#define RUBY_RELEASE_YEAR 2016
66
#define RUBY_RELEASE_MONTH 4

0 commit comments

Comments
 (0)