Method: Mysql::Time#to_s
- Defined in:
- ext/mysql_api/mysql.c
#to_s ⇒ Object
1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 |
# File 'ext/mysql_api/mysql.c', line 1801
static VALUE time_to_s(VALUE obj)
{
char buf[20];
sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d",
NUM2INT(rb_iv_get(obj, "year")),
NUM2INT(rb_iv_get(obj, "month")),
NUM2INT(rb_iv_get(obj, "day")),
NUM2INT(rb_iv_get(obj, "hour")),
NUM2INT(rb_iv_get(obj, "minute")),
NUM2INT(rb_iv_get(obj, "second")));
return rb_str_new2(buf);
}
|