PDA

View Full Version : Differences in Date formatting Mac/Win



Kesy
8th January 2009, 13:33
Hi all,
as you can see in the two images, Date is formatted with differences on Mac and on Win
here is the code:



#include "CustomModel.h"
#include <QtGui>


CustomModel::CustomModel(QObject *parent): QSqlQueryModel(parent) {
}

QVariant CustomModel::data(const QModelIndex &index, int role) const {
QVariant value = QSqlQueryModel::data(index, role);
if (value.isValid() && role == Qt::DisplayRole) {
if (index.column() == 1)
return value.toString();
else if (index.column() == 2)
return value.toString();
else if (index.column() == 3)
return QDateTime::fromString(value.toString(),"dd.MM.yyyy hh:mm:ss");


}
return value;
}


Mac:
http://img253.imageshack.us/my.php?image=immagine18uz4.png


Win:
http://img187.imageshack.us/my.php?image=datako9.jpg

Does anybody know why?

Thanks, Bye