Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.2.0, 6.7
-
None
Description
I just found a case where QDateTime::fromString() fails to parse date and time formats that use spaces for padding. For example "Feb 3 2014 15:15:12" can not be parsed by QDateTime (please not the padded space before the day). This format is returned e.g. by __DATE__ macro (as provided by VC++) so it is actually used.
Please add an option to QDateTime::fromString() that allows specifying such a format or make the options that accept leading zeros more flexible by also accepting leading spaces.
(Clarification: in the given string, "Feb 3 …" has two spaces between Feb and 3, the second of which is the padding of 3 to fill a two-digit field. QDateTime::fromString() supports two-digit fields but expects single digit values in them to be zero-padded, not space-padded.)
Attachments
Issue Links
- relates to
-
QTBUG-77948 Rewrite QDateTimeParser
- In Progress
-
QTBUG-62111 Docs: Fixed day/year format in QDateTime
- Closed