The QDate class provides date functions. More...
#include <qdatetime.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 day 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.
See also: QTime and QDateTime.
Examples: dclock/dclock.cpp
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.
[static]
Returns the current date.
See also: QTime::currentTime() and QDateTime::currentDateTime().
Returns the day of the month (1..31) for this date.
See also: year(), month() and dayOfWeek().
Examples: dclock/dclock.cpp
[virtual]
Returns the name of the weekday.
Weekday 1 == "Mon", day 2 == "Tue" etc.
Returns the weekday (Monday=1 .. Sunday=7) for this date.
See also: day().
Returns the day of the year (1..365) for this date.
Returns the number of days in the month (28..31) for this date.
Returns the number of days in the year (365 or 366) for this date.
Returns the number of days from this date to d, which is negative if d is in the past.
Example:
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
See also: addDays().
[static protected]
For internal use only.
Returns TRUE if the date is null. A null date is invalid.
See also: isValid().
Returns TRUE if the date is valid.
See also: isNull().
[static]
Returns TRUE if the specified date is valid.
Note that years 00-99 are treated as 1900-1999.
See also: isNull().
[static protected]
For internal use only.
[static]
Returns TRUE if the specified year y is a leap year.
Returns the month (January=1 .. December=12) for this date.
Examples: dclock/dclock.cpp
[virtual]
Returns the name of the month.
Month 1 == "Jan", month 2 == "Feb" etc.
Returns TRUE if this date is different from d, or FALSE if they are equal.
Returns TRUE if this date is before d, otherwise FALSE.
Returns TRUE if this date is before or equal to d, otherwise FALSE.
Returns TRUE if this date is equal to d, or FALSE if they are different.
Returns TRUE if this date is after d, otherwise FALSE.
Returns TRUE if this date is equal to or after d, otherwise FALSE.
Sets the year y, month m and day d. Returns TRUE if the date is valid, otherwise FALSE.
Returns the date as a string.
The string format is "Sat May 20 1995".
Returns the year (>= 1752) for this date.
Writes the date to the stream.
Serialization format: [Q_UINT32], Julian day.
Reads a date from the stream.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright © 1998 Troll Tech | Trademarks | Qt version 1.42
|