How to convert date to string?
Posted by: James Leo
Date: March 16, 2021 03:22AM

It's my first time to use the connector 8. (I'v installed the x64 MySQL, but there are some lib in 32bit, so I'd build the exe in 32 bit by VS2015. and I can't find the libmysql bin file (32bit) to use. )
In last project (use x64 libmysql) ,it's easy to read and convert the DATE field from table.
Now work with connector, there is something differ from stand MySql 's query.
Refer to the doc, the DATE value will be convert to number, but I don't konw what number it will be.
Is the number like '20200909' or just a timestamp?
I tried the follow function: ( col =3, DATE type )

mysqlx_get_uint(row, 3, &ndate); --> this return the value:
ndate 14757395258967641292 unsigned __int64

Is this the senconds? or ticks? unlike the time function's result:
time_t now;
time(&now); -->now 1615885732 __int64

How to convert the int value to date string?



Options: ReplyQuote

Written By
How to convert date to string?
March 16, 2021 03:22AM
March 16, 2021 08:49PM
March 19, 2021 02:54AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.