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");
I know that date is in UTC because that is the way it's stored. But when I want to display this date to the user, it should be in the user's local time zone. date.toLocalTime() looks promising, but it returns the exact same date!
How do I convert date to the system's local time to display to the user?
Here are some more failures:
#include
#include
#include
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QDateTime date = QDateTime::fromString("2010-10-25T10:28:58.570Z", "yyyy-MM-ddTHH:mm:ss.zzzZ");
QDateTime local = date.toLocalTime();
qDebug() << "utc: &#