diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-22 23:16:40 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-22 23:16:40 +0900 |
| commit | a9a91c3561ff68d361c7aaf5bfd3379598012c82 (patch) | |
| tree | d90b5c05aeb40322144cdacff6b5a665ab990d5e | |
| parent | 3de8c4441e7c6345ae35a818ff0213db549849f3 (diff) | |
| download | mruby-a9a91c3561ff68d361c7aaf5bfd3379598012c82.tar.gz mruby-a9a91c3561ff68d361c7aaf5bfd3379598012c82.zip | |
Time.at should take optional second argument
| -rw-r--r-- | src/time.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/time.c b/src/time.c index 45e796069..94b76c8f9 100644 --- a/src/time.c +++ b/src/time.c @@ -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); } |
