ok, I'll try.

you convert a QDateTime (at least I hope it's a QDateTime) into a QString. You use Qt::TextDate as string format. Then you reconvert this string into a QDateTime using a different format ("yyyy-MM-dd hh:mm:ss"). No wonder that fails.