PDA

View Full Version : date



AnithaRagupathy
31st October 2007, 08:27
hi i m an beginner bear with me.
i m getting a date as qstring.
I need to get the day,month and year alone from this date which is QString.
and then want to display in a particular format like yr-month-day
thanks

jpn
31st October 2007, 09:00
See QDate::fromString() and QDate::toString().

AnithaRagupathy
2nd November 2007, 04:53
hi i m passing a date in 20/10/2007 format and
if i give
QDate datee = QDate::fromString(pi_date, "yyyy/MM/dd");
to convert it to date
and if try to get year of that date like
quint32 Yearr=datee.year();
.I m getting some junk value as my year while executing.
Wt s the prob with the above code.

kernel_panic
2nd November 2007, 07:28
QDate datee = QDate::fromString(pi_date, dd/MM/yyyy");