MySQL Forums
Forum List  »  Connector/C (libmysql)

Re: How to convert date to string?
Posted by: James Leo
Date: March 16, 2021 08:49PM

Hi, Peter,
Thanks for your reply.
I know that MySQL's query (e.g. 'SELECT DATE_FORMAT()')can do it, but not convenient.
Usually, I fetch rows from DB including many fields of type int, unit, DATE, string ,int .... and just want to convert the DATE value to string to display or compare or convert it.
In MySQL x64 version, I use the libmysql.lib to fetch a row, and the DATE value returned as string (or you can use printf ("%s") or CString::Format("%s") to convert to string). It's easy to do.

If I process the DATE with SELECT str_to_date(), how to get/process the other value in the same row?

I hope there is a function like mysqlx_get_date() in connector.

Thanks a lot.

Best Regards.

James

Options: ReplyQuote


Subject
Views
Written By
Posted
368
March 16, 2021 03:22AM
Re: How to convert date to string?
219
March 16, 2021 08:49PM
212
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.