Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.1
-
None
-
Ubuntu 9.04 with Qt4.6.1
Description
the following code shows the issue:
QLocale locale = QLocale(QLocale::English); //QString dateTimeStr = QString("Monday, January 5, 2009 11:48:32 AM"); // with no blank space char after "AM", this date time str cannot be parsed correctly QString dateTimeStr = QString("Monday, January 5, 2009 11:48:32 AM "); //QDateTime value = locale.toDateTime(dateTimeStr , locale.dateTimeFormat(QLocale::LongFormat)); // this will success QDateTime value = locale.toDateTime(dateTimeStr , QLocale::LongFormat); // cannot return right QDateTime value
souce code of "toDateTime"
QDateTime QLocale::toDateTime(const QString &string, FormatType format) const { return toDateTime(string, dateFormat(format)); // "dateFormat" should be replaced by "dateTimeFormat" }
Attachments
Issue Links
- resulted in
-
QTBUG-8288 Datetime formats in QLocale contain unnecessary spaces
-
- Closed
-