Method: Time.now
- Defined in:
- time.c
permalink .now ⇒ Time
Creates a new Time object for the current time. This is same as Time.new without arguments.
Time.now #=> 2009-06-24 12:39:54 +0900
2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 |
# File 'time.c', line 2752
static VALUE
time_s_now(int argc, VALUE *argv, VALUE klass)
{
VALUE vals[TMOPT_MAX_], opts, t, zone = Qundef;
rb_scan_args(argc, argv, ":", &opts);
if (get_tmopt(opts, vals)) zone = vals[TMOPT_IN];
t = rb_class_new_instance(0, NULL, klass);
if (zone != Qundef) {
time_zonelocal(t, zone);
}
return t;
}
|