/* * call-seq: * time.asctime => string * time.ctime => string * * Returns a canonical string representation of <i>time</i>. * * Time.now.asctime #=> "Wed Apr 9 08:56:03 2003" */ static VALUE time_asctime(time) VALUE time; { struct time_object *tobj; char *s; GetTimeval(time, tobj); if (tobj->tm_got == 0) { time_get_tm(time, tobj->gmt); } s = asctime(&tobj->tm); if (s[24] == '\n') s[24] = '\0'; return rb_str_new2(s); }