ctime()
public
Show source
static VALUE
time_asctime(VALUE time)
{
struct time_object *tobj;
char *s;
IF_HAVE_GMTIME_R(char buf[32]);
GetTimeval(time, tobj);
if (tobj->tm_got == 0) {
time_get_tm(time, tobj->gmt);
}
s = ASCTIME(&tobj->tm, buf);
if (s[24] == '\n') s[24] = '\0';
/* workaround for MSVCRT's bug */
if (s[8] == '0') s[8] = ' ';
return rb_str_new2(s);
}