[SOLVED] Is there anyway to take date from "20120912"?
-
How could you take the date from "20120912"?
take the 4 numbers from left, then remove them, take the 2 numbers from left, remove them and so you have
12/09/2012?Is there anything specific that can do this?
-
You can simply use "QDate":http://qt-project.org/doc/qt-4.8/qdate.html#fromString-2 for this:
@
qDebug() << QDate::fromString("20120912",yyyyMMdd);
@ -
[quote author="AcerExtensa" date="1348488095"]You can simply use "QDate":http://qt-project.org/doc/qt-4.8/qdate.html#fromString-2 for this:
@
qDebug() << QDate::fromString(yyyyMMdd);
@[/quote]i was aware from qdatefromstring, but i was using it the wrong way.. thanks :)