View Full Version : date

31st October 2007, 07: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

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

2nd November 2007, 03: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.

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