Priority: Not Evaluated
Affects Version/s: 4.8.4
Fix Version/s: None
Component/s: Core: Date/Time
Environment:Win 7, PyQt4, Qt 4.8.4
Reproduced on 4.6.something in C++
I'm having an issue with the 'yy' matcher (but not the 'yyyy' matcher) on QDateTime. The code fragment below is Python (using PyQt bindings for the Qt application framework v4.8.4), but it has been reproduced by a C++ respondant on a forum:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
date_works_text = u'Monday, 23 April 2012 22:51:41'
date_works_pattern = u'dddd, d MMMM yyyy hh:mm:ss'
date_broken_text = u'Monday, 23 April 12 22:51:41'
date_broken_pattern = u'dddd, d MMMM yy hh:mm:ss'
date_works = QDateTime.fromString(date_works_text, date_works_pattern)
date_broken = QDateTime.fromString(date_broken_text, date_broken_pattern)
The output on my system is:
Mon Apr 23 22:51:41 2012
<blank line where the second toString() should be>
It appears to dislike a 'yy' match on '12' even though the pattern is included in the QDateTime format (http://qt-project.org/doc/qt-4.8/qdatetime.html#fromString)