tags:

views:

59

answers:

2

Hi,

I want to count the days passed with respect to a given date. I have a predefined date with me and i want to check the days passed, once the day pass 30 days with respect to the given time i want to get a message.

example given date is25/03/2010 and when my system date reaches 25/04/2010 i have to get a message. How can i implement it. please give some help

+4  A: 

Not tested, but this is the logic:

QDate original = QDate(your_year, your_month, your_date);
original.addDays(30);

if (original > QDate::currentDate())
{
    displayMessage();
}

http://doc.qt.nokia.com/4.6/qdate.html

laura
A: 

QDateTime::daysTo(const QDateTime &other) should do the work

Kamil Klimek