mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Time.at should take optional second argument
This commit is contained in:
+3
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user