Hi,
Is there a class that return the difference between to given dates?
Thanks
Mohammad
Hi,
Is there a class that return the difference between to given dates?
Thanks
Mohammad
Last edited by ChrisW67; 21st August 2009 at 04:51.
MIH1406 (3rd June 2010)
This is good
Thank you
Mohammad
i have a doubt..pls help..
i have 2 QDateEdits..ie one s start_date and other is end_date..i want to find difference between them and display in a QLineEdit..how to do it?
i did
int s=ui->start_date.day();
int e=ui->end_date.day();
int diff=e-s; //this works correctly it returns the difference
Qstring d=diff.toString(); //here am getting junk values y?
ui->line_edit->setText(d);
Last edited by hemapriya; 19th August 2012 at 06:59.
try daysTo() function.
Ex:
Qt Code: Switch view
QDate date1;
QDate date2;
int nDiff = date1.daysTo(date2);
ui->line_edit->setText(QString::number(nDiff));
To copy to clipboard, switch view to plain text mode
Qstring d=diff.toString(); //here am getting junk values y?
you need to convert the int to string ().
hope it helps
Bookmarks