The QDate class provides date functions. (details) (complete member list)
#include <qdatetm.h>
The QDate is based on the Gregorian (modern western) calendar. England adopted the Gregorian calendar on September 14th 1752, which is the earliest date that is supported by QDate. Using earlier dates will give undefined results. Some countries adopted the Gregorian calendar later than England, thus the week dat of early dates might be incorrect for these countries (but correct for England). The end of time is reached around 8000AD, by which time we expect Qt to be obsolete.
Constructs a null date. Null dates are invalid.
Constructs a date with the year y, month m and day d.
Returns this date plus ndays days.
Returns the current date.
Returns the day part (1..31) of the date.
Returns the name of the weekday. Weekday 1 == "Mon", day 2 == "Tue" etc.
Returns the weekday (1..7) of the date. Monday is the first day.
Returns the day of the year (1..365) of the date.
Returns the day of the month (1..31) of the date.
Returns the number of days in the year (365 or 366).
Returns the number of days between this date and e:
QDate d1( 1995, 5, 17 ); // May 17th 1995
QDate d2( 1995, 5, 20 ); // May 20th 1995
d1.daysTo( d2 ); // returns 3
d2.daysTo( d1 ); // returns -3
Returns TRUE if the date is null.
See also: isValid().
Returns TRUE if the date is valid.
See also: isNull().
Returns TRUE if the specified date is valid.
Returns TRUE if the specified year y is a leap year.
Returns the month part (1..12) of the date.
Returns the name of the month. Month 1 == "Jan", month 2 == "Feb" etc.
Sets the year y, month m and day d. Returns TRUE if the date is valid, FALSE if it is invalid.
Returns the date as a string. The string format is "Sat May 20 1995".
Returns the year part (>= 1752) of the date.
Writes the date d to the stream s and returns a reference to s.
Reads the date d from the stream s and returns a reference to s.
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: