[SOLVED] storing system date in a variable
-
I need to store the current system date in ddMMyyyy format (without periods nor slashes in between) in a variable. Someone sgow me a simple snippet please.
-
Try this:
@
QString str = QDate::currentDate().toString ( "ddMMyyyy" );
@Note: not tested, brain to keyboard.
-
Look at QDate's "toString":http://doc.qt.nokia.com/4.7-snapshot/qdate.html#toString member function
-
"QDate::currentDate()":http://qt-project.org/doc/qt-4.8/qdate.html#currentDate
"QDate::toString()":http://qt-project.org/doc/qt-4.8/qdate.html#toString@
QString systemDate = QDate::currentDate().toString("ddMMyyyy");
@