Bug #6193 » ruby-time-sec-str.patch
time.c (working copy) | ||
---|---|---|
vtm.sec = 0;
|
||
vtm.subsecx = INT2FIX(0);
|
||
if (!NIL_P(v[5])) {
|
||
VALUE sec = num_exact(v[5]);
|
||
VALUE sec = obj2vint(v[5]);
|
||
VALUE subsec;
|
||
divmodv(sec, INT2FIX(1), &sec, &subsec);
|
||
vtm.sec = NUM2INT(sec);
|
ChangeLog (working copy) | ||
---|---|---|
Fri Mar 23 21:21:17 2012 Sambasiva Rao Suda <sambasivarao@gmail.org>
|
||
* time.c (time_init_1): Time.new will accept seconds as string or int.
|
||
[ruby-core:43569] [Bug #6193]
|
||
Fri Mar 23 15:12:12 2012 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||
* transcode.c (documentation for str_encode): Explain
|
test/test_time.rb (working copy) | ||
---|---|---|
bug4456 = '[ruby-dev:43284]'
|
||
assert_normal_exit %q{ Time.now.strftime("%1000000000F") }, bug4456
|
||
end
|
||
def test_sec_str
|
||
bug6193 = '[ruby-core:43569]'
|
||
assert_normal_exit %q{ Time.new(2012, 1, 2, 3, 4, "5") }, bug6193
|
||
assert_equal(Time.new(2012, 1, 2, 3, 4, 5), Time.new(2012, 1, 2, 3, 4, "5"))
|
||
end
|
||
end
|