Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QDate QDate::currentDate (  )  [static]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Returns the current date, as reported by the system clock.

See also:
QTime::currentTime(), QDateTime::currentDateTime()

Definition at line 945 of file qdatetime.cpp.

References jd.

Referenced by Window::createDateTimeEdits(), MainWindow::createLetter(), QDateTime::currentDateTime(), Q3DateEdit::fix(), MainWindow::insertCalendar(), MainWindow::newLetter(), and QCalendarWidget::showToday().

    QDate d;
#if defined(Q_OS_WIN)
    memset(&st, 0, sizeof(SYSTEMTIME));
    d.jd = julianDayFromDate(st.wYear, st.wMonth, st.wDay);
    // posix compliant system
    time_t ltime;
    tm *t = 0;

    // use the reentrant version of localtime() where available
    tm res;
    t = localtime_r(&ltime, &res);
    t = localtime(&ltime);

    d.jd = julianDayFromDate(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday);
    return d;

Generated by  Doxygen 1.6.0   Back to index