PDA

View Full Version : QDateTime without Day



raphaelf
16th February 2006, 10:25
Hello everybody,

OS: WINXP
Compiler: MINGW
QT: 3.4

I am trying to get my current date with time without Day "DO".
With following function i get this: "Do 16. Feb 10:00:59 2006".
How could i get just: "16. Feb 10:00:59 2006" ??



QDateTime dt = QDateTime::currentDateTime();
QString datum = dt.toString(); //"Do 16. Feb 10:00:59 2006".


I tried this:


QString date = dt.toString(d.M.yy);
QString time = dt.toString(h:m:s);
QString complete = date + " " + time;



Can somebody help?

THX

zlatko
16th February 2006, 10:29
QString date = dt.toString(M.yy);


doesnt help?

raphaelf
16th February 2006, 10:39
Hi,
If i use following code i get a error:


QDateTime dt = QDateTime::currentDateTime();
QString datum = dt.toString(M.yy);


error:


ergebnisse.cpp:124: error: `M' undeclared (first use this function)
ergebnisse.cpp:124: error: (Each undeclared identifier is reported only once for
each function it appears in.)

zlatko
16th February 2006, 10:59
sorry



QString date = dt.toString("M.yy");

raphaelf
16th February 2006, 11:42
of course :p
thank you it works perfect..