Time.at should take optional second argument

This commit is contained in:
Yukihiro Matsumoto
2012-07-22 23:16:40 +09:00
parent 3de8c4441e
commit a9a91c3561
+3 -2
View File
@@ -227,9 +227,10 @@ mrb_time_now(mrb_state *mrb, mrb_value self)
static mrb_value
mrb_time_at(mrb_state *mrb, mrb_value self)
{
mrb_float f;
mrb_float f, f2 = 0;
mrb_get_args(mrb, "f", &f);
mrb_get_args(mrb, "f|f", &f, &f2);
f += f2 * 1e-6;
return mrb_time_make(mrb, mrb_class_ptr(self), f, MRB_TIMEZONE_LOCAL);
}