I am using the MySQL C API within a C++ application. I have a column in my result set that is of the type MYSQL_TIME (part of mysql.h).
我正在一个c++应用程序中使用MySQL C API。我的结果集中有一个列,它的类型是MYSQL_TIME (mysql.h的一部分)。
Is there a way to convert MYSQL_TIME to a char* or to a C++ string?
有没有办法将MYSQL_TIME转换为char*或c++字符串?
1 个解决方案
#1
3
I figured it out:
我想通了:
fprintf(stdout, " %04d-%02d-%02d %02d:%02d:%02d (%ld)\n",
ts.year, ts.month, ts.day,
ts.hour, ts.minute, ts.second,
length[3]);
where length[3] contains the length of ts.
其中,长度[3]包含ts的长度。
#1
3
I figured it out:
我想通了:
fprintf(stdout, " %04d-%02d-%02d %02d:%02d:%02d (%ld)\n",
ts.year, ts.month, ts.day,
ts.hour, ts.minute, ts.second,
length[3]);
where length[3] contains the length of ts.
其中,长度[3]包含ts的长度。