I construct a QDateTime from a string like this:
QDateTime date = QDateTime::fromString(\"2010-10-25T10:28:58.570Z\", \"yyyy-MM-ddTHH:mm:ss.zzzZ\");
Is using QDateTime::toString() not giving you expected results ?
Maybe you could try using a different format with QDateTime::toString(Qt::SystemLocaleLongDate)
or QDateTime::toString(Qt::SystemLocaleShortDate)
.
Otherwise, I would try to use QLocale::dateTimeFormat() to get the local format as a QString
and then use this string as the format parameter of QDateTime::toString(), but I don't think it will change anything.