[Solved]convert mysql time to QDateTime and vise versa
-
Hi ALL
how can i convert Mysql time to QDateTime ?
thanks in advance . -
The Qt Sql drivers do that for you already. You can just use QVariant::toDateTime on your query result.
-
thanks that works.
-
Hi
how can i convert a QDateTime to Mysql datetime ?thanks in advance
-
.toString("yyyy-MM-dd hh:mm:ss");
-
[quote author="Naouali" date="1306334812"]Hi
how can i convert a QDateTime to Mysql datetime ?thanks in advance[/quote]
Same way as you do it the other way around: simply rely on the Qt Sql drivers framework to do that for you.
I merged this question with the one you asked about doing it the other way around.