ext/oj/object.c in oj-2.12.8 vs ext/oj/object.c in oj-2.12.9
- old
+ new
@@ -344,10 +344,14 @@
args[0] = LONG2NUM(1900 + st->tm_year);
args[1] = LONG2NUM(1 + st->tm_mon);
args[2] = LONG2NUM(st->tm_mday);
args[3] = LONG2NUM(st->tm_hour);
args[4] = LONG2NUM(st->tm_min);
+#if NO_TIME_ROUND_PAD
+ args[5] = rb_float_new((double)st->tm_sec + ((double)nsec) / 1000000000.0);
+#else
args[5] = rb_float_new((double)st->tm_sec + ((double)nsec + 0.5) / 1000000000.0);
+#endif
args[6] = LONG2NUM(ni->exp);
parent->val = rb_funcall2(rb_cTime, oj_new_id, 7, args);
#endif
} else {
#if HAS_NANO_TIME