QString querytime="SELECT CREATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA ='"+databasename+"' AND TABLE_NAME ='"+table+"'";

if(query.exec(querytime))

cout<<"TIME STAMP>>
<<query.value(0).toString().toStdString();

This is the C++ code i used in QT to retrieve the create time of table from MYSQL database. This query is working properly in mysql query editor and gets the results in datetime format. How can i retrieve this result in QT?