Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5016

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdatetime.cpp -->
  <title>Qt 4.8: QDate Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QDate</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#use-of-gregorian-and-julian-calendars">Use of Gregorian and Julian Calendars</a></li>
<li class="level3"><a href="#use-of-gregorian-and-julian-calendars">Use of Gregorian and Julian Calendars</a></li>
<li class="level3"><a href="#no-year-0">No Year 0</a></li>
<li class="level3"><a href="#range-of-valid-dates">Range of Valid Dates</a></li>
</ul>
</div>
<h1 class="title">QDate Class Reference</h1>
<!-- $$$QDate-brief -->
<p>The QDate class provides date functions. <a href="#details">More...</a></p>
<!-- @@@QDate -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDate&gt;</span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qdate-members.html">List of all members, including inherited members</a></li>
<li><a href="qdate-obsolete.html">Obsolete members</a></li>
<li><a href="qdate-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#MonthNameType-enum">MonthNameType</a></b> { DateFormat, StandaloneFormat }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#QDate">QDate</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#QDate-2">QDate</a></b> ( int <i>y</i>, int <i>m</i>, int <i>d</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#addDays">addDays</a></b> ( int <i>ndays</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#addMonths">addMonths</a></b> ( int <i>nmonths</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#addYears">addYears</a></b> ( int <i>nyears</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#day">day</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#dayOfWeek">dayOfWeek</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#dayOfYear">dayOfYear</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#daysInMonth">daysInMonth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#daysInYear">daysInYear</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#daysTo">daysTo</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#getDate">getDate</a></b> ( int * <i>year</i>, int * <i>month</i>, int * <i>day</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#month">month</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#setDate">setDate</a></b> ( int <i>year</i>, int <i>month</i>, int <i>day</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#toJulianDay">toJulianDay</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#toString">toString</a></b> ( const QString &amp; <i>format</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#toString-2">toString</a></b> ( Qt::DateFormat <i>format</i> = Qt::TextDate ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#weekNumber">weekNumber</a></b> ( int * <i>yearNumber</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#year">year</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-not-eq">operator!=</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-lt">operator&lt;</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-lt-eq">operator&lt;=</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-eq-eq">operator==</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-gt">operator&gt;</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-gt-eq">operator&gt;=</a></b> ( const QDate &amp; <i>d</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#currentDate">currentDate</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#fromJulianDay">fromJulianDay</a></b> ( int <i>jd</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#fromString">fromString</a></b> ( const QString &amp; <i>string</i>, Qt::DateFormat <i>format</i> = Qt::TextDate )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#fromString-2">fromString</a></b> ( const QString &amp; <i>string</i>, const QString &amp; <i>format</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#isLeapYear">isLeapYear</a></b> ( int <i>year</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#isValid-2">isValid</a></b> ( int <i>year</i>, int <i>month</i>, int <i>day</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#longDayName">longDayName</a></b> ( int <i>weekday</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#longDayName-2">longDayName</a></b> ( int <i>weekday</i>, MonthNameType <i>type</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#longMonthName">longMonthName</a></b> ( int <i>month</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#longMonthName-2">longMonthName</a></b> ( int <i>month</i>, MonthNameType <i>type</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#shortDayName">shortDayName</a></b> ( int <i>weekday</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#shortDayName-2">shortDayName</a></b> ( int <i>weekday</i>, MonthNameType <i>type</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#shortMonthName">shortMonthName</a></b> ( int <i>month</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#shortMonthName-2">shortMonthName</a></b> ( int <i>month</i>, MonthNameType <i>type</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-lt-lt">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>out</i>, const QDate &amp; <i>date</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdate.html#operator-gt-gt">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>in</i>, QDate &amp; <i>date</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QDate-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDate class provides date functions.</p>
<p>A QDate object contains a calendar date, i.e&#x2e; year, month, and day numbers, in the Gregorian calendar. (see <a href="#qdate-g-and-j">Use of Gregorian and Julian Calendars</a> for dates prior to 15 October 1582). It can read the current date from the system clock. It provides functions for comparing dates, and for manipulating dates. For example, it is possible to add and subtract days, months, and years to dates.</p>
<p>A QDate object is typically created either by giving the year, month, and day numbers explicitly. Note that QDate interprets two digit years as is, i.e&#x2e;, years 0 - 99. A QDate can also be constructed with the static function <a href="qdate.html#currentDate">currentDate</a>(), which creates a QDate object containing the system clock's date. An explicit date can also be set using <a href="qdate.html#setDate">setDate</a>(). The <a href="qdate.html#fromString">fromString</a>() function returns a QDate given a string and a date format which is used to interpret the date within the string.</p>
<p>The <a href="qdate.html#year">year</a>(), <a href="qdate.html#month">month</a>(), and <a href="qdate.html#day">day</a>() functions provide access to the year, month, and day numbers. Also, <a href="qdate.html#dayOfWeek">dayOfWeek</a>() and <a href="qdate.html#dayOfYear">dayOfYear</a>() functions are provided. The same information is provided in textual format by the <a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), <a href="qdate.html#longDayName">longDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>() functions.</p>
<p>QDate provides a full set of operators to compare two QDate objects where smaller means earlier, and larger means later.</p>
<p>You can increment (or decrement) a date by a given number of days using <a href="qdate.html#addDays">addDays</a>(). Similarly you can use <a href="qdate.html#addMonths">addMonths</a>() and <a href="qdate.html#addYears">addYears</a>(). The <a href="qdate.html#daysTo">daysTo</a>() function returns the number of days between two dates.</p>
<p>The <a href="qdate.html#daysInMonth">daysInMonth</a>() and <a href="qdate.html#daysInYear">daysInYear</a>() functions return how many days there are in this date's month and year, respectively. The <a href="qdate.html#isLeapYear">isLeapYear</a>() function indicates whether a date is in a leap year.</p>
<a name="use-of-gregorian-and-julian-calendars"></a>
<a name="qdate-g-and-j"></a><a name="use-of-gregorian-and-julian-calendars"></a>
<h4>Use of Gregorian and Julian Calendars</h4>
<p>QDate uses the Gregorian calendar in all locales, beginning on the date 15 October 1582. For dates up to and including 4 October 1582, the Julian calendar is used. This means there is a 10-day gap in the internal calendar between the 4th and the 15th of October 1582. When you use <a href="qdatetime.html">QDateTime</a> for dates in that epoch, the day after 4 October 1582 is 15 October 1582, and the dates in the gap are invalid.</p>
<p>The Julian to Gregorian changeover date used here is the date when the Gregorian calendar was first introduced, by Pope Gregory XIII. That change was not universally accepted and some localities only executed it at a later date (if at all). <a href="qdatetime.html">QDateTime</a> doesn't take any of these historical facts into account. If an application must support a locale-specific dating system, it must do so on its own, remembering to convert the dates using the Julian day.</p>
<a name="no-year-0"></a>
<h4>No Year 0</h4>
<p>There is no year 0. Dates in that year are considered invalid. The year -1 is the year &quot;1 before Christ&quot; or &quot;1 before current era.&quot; The day before 0001-01-01 is December 31st, 1 BCE.</p>
<a name="range-of-valid-dates"></a>
<h4>Range of Valid Dates</h4>
<p>The range of valid dates is from January 2nd, 4713 BCE, to sometime in the year 11 million CE. The Julian Day returned by <a href="qdate.html#toJulianDay">QDate::toJulianDay</a>() is a number in the contiguous range from 1 to <i>overflow</i>, even across <a href="qdatetime.html">QDateTime</a>'s &quot;date holes&quot;. It is suitable for use in applications that must convert a <a href="qdatetime.html">QDateTime</a> to a date in another calendar system, e.g&#x2e;, Hebrew, Islamic or Chinese.</p>
</div>
<p><b>See also </b><a href="qtime.html">QTime</a>, <a href="qdatetime.html">QDateTime</a>, <a href="qdateedit.html">QDateEdit</a>, <a href="qdatetimeedit.html">QDateTimeEdit</a>, and <a href="qcalendarwidget.html">QCalendarWidget</a>.</p>
<!-- @@@QDate -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$MonthNameType$$$DateFormat$$$StandaloneFormat -->
<h3 class="fn"><a name="MonthNameType-enum"></a>enum QDate::<span class="name">MonthNameType</span></h3>
<p>This enum describes the types of the string representation used for the month name.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QDate::DateFormat</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">This type of name can be used for date-to-string formatting.</td></tr>
<tr><td class="topAlign"><tt>QDate::StandaloneFormat</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">This type is used when you need to enumerate months or weekdays. Usually standalone names are represented in singular forms with capitalized first letter.</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.5.</p>
<!-- @@@MonthNameType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDate[overload1]$$$QDate -->
<h3 class="fn"><a name="QDate"></a>QDate::<span class="name">QDate</span> ()</h3>
<p>Constructs a null date. Null dates are invalid.</p>
<p><b>See also </b><a href="qdate.html#isNull">isNull</a>() and <a href="qdate.html#isValid">isValid</a>().</p>
<!-- @@@QDate -->
<!-- $$$QDate$$$QDateintintint -->
<h3 class="fn"><a name="QDate-2"></a>QDate::<span class="name">QDate</span> ( <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>m</i>, <span class="type">int</span> <i>d</i> )</h3>
<p>Constructs a date with year <i>y</i>, month <i>m</i> and day <i>d</i>.</p>
<p>If the specified date is invalid, the date is not set and <a href="qdate.html#isValid">isValid</a>() returns false. A date before 2 January 4713 B.C&#x2e; is considered invalid.</p>
<p><b>Warning:</b> Years 0 to 99 are interpreted as is, i.e&#x2e;, years 0-99.</p>
<p><b>See also </b><a href="qdate.html#isValid">isValid</a>().</p>
<!-- @@@QDate -->
<!-- $$$addDays[overload1]$$$addDaysint -->
<h3 class="fn"><a name="addDays"></a><span class="type">QDate</span> QDate::<span class="name">addDays</span> ( <span class="type">int</span> <i>ndays</i> ) const</h3>
<p>Returns a <a href="qdate.html">QDate</a> object containing a date <i>ndays</i> later than the date of this object (or earlier if <i>ndays</i> is negative).</p>
<p><b>See also </b><a href="qdate.html#addMonths">addMonths</a>(), <a href="qdate.html#addYears">addYears</a>(), and <a href="qdate.html#daysTo">daysTo</a>().</p>
<!-- @@@addDays -->
<!-- $$$addMonths[overload1]$$$addMonthsint -->
<h3 class="fn"><a name="addMonths"></a><span class="type">QDate</span> QDate::<span class="name">addMonths</span> ( <span class="type">int</span> <i>nmonths</i> ) const</h3>
<p>Returns a <a href="qdate.html">QDate</a> object containing a date <i>nmonths</i> later than the date of this object (or earlier if <i>nmonths</i> is negative).</p>
<p><b>Note:</b> If the ending day/month combination does not exist in the resulting month/year, this function will return a date that is the latest valid date.</p>
<p><b>Warning:</b> <a href="qdate.html">QDate</a> has a date hole around the days introducing the Gregorian calendar (the days 5 to 14 October 1582, inclusive, do not exist). If the calculation ends in one of those days, <a href="qdate.html">QDate</a> will return either October 4 or October 15.</p>
<p><b>See also </b><a href="qdate.html#addDays">addDays</a>() and <a href="qdate.html#addYears">addYears</a>().</p>
<!-- @@@addMonths -->
<!-- $$$addYears[overload1]$$$addYearsint -->
<h3 class="fn"><a name="addYears"></a><span class="type">QDate</span> QDate::<span class="name">addYears</span> ( <span class="type">int</span> <i>nyears</i> ) const</h3>
<p>Returns a <a href="qdate.html">QDate</a> object containing a date <i>nyears</i> later than the date of this object (or earlier if <i>nyears</i> is negative).</p>
<p><b>Note:</b> If the ending day/month combination does not exist in the resulting year (i.e&#x2e;, if the date was Feb 29 and the final year is not a leap year), this function will return a date that is the latest valid date (that is, Feb 28).</p>
<p><b>See also </b><a href="qdate.html#addDays">addDays</a>() and <a href="qdate.html#addMonths">addMonths</a>().</p>
<!-- @@@addYears -->
<!-- $$$currentDate[overload1]$$$currentDate -->
<h3 class="fn"><a name="currentDate"></a><span class="type">QDate</span> QDate::<span class="name">currentDate</span> ()<tt> [static]</tt></h3>
<p>Returns the current date, as reported by the system clock.</p>
<p><b>See also </b><a href="qtime.html#currentTime">QTime::currentTime</a>() and <a href="qdatetime.html#currentDateTime">QDateTime::currentDateTime</a>().</p>
<!-- @@@currentDate -->
<!-- $$$day[overload1]$$$day -->
<h3 class="fn"><a name="day"></a><span class="type">int</span> QDate::<span class="name">day</span> () const</h3>
<p>Returns the day of the month (1 to 31) of this date.</p>
<p><b>See also </b><a href="qdate.html#year">year</a>(), <a href="qdate.html#month">month</a>(), and <a href="qdate.html#dayOfWeek">dayOfWeek</a>().</p>
<!-- @@@day -->
<!-- $$$dayOfWeek[overload1]$$$dayOfWeek -->
<h3 class="fn"><a name="dayOfWeek"></a><span class="type">int</span> QDate::<span class="name">dayOfWeek</span> () const</h3>
<p>Returns the weekday (1 = Monday to 7 = Sunday) for this date.</p>
<p><b>See also </b><a href="qdate.html#day">day</a>(), <a href="qdate.html#dayOfYear">dayOfYear</a>(), and <a href="qt.html#DayOfWeek-enum">Qt::DayOfWeek</a>.</p>
<!-- @@@dayOfWeek -->
<!-- $$$dayOfYear[overload1]$$$dayOfYear -->
<h3 class="fn"><a name="dayOfYear"></a><span class="type">int</span> QDate::<span class="name">dayOfYear</span> () const</h3>
<p>Returns the day of the year (1 to 365 or 366 on leap years) for this date.</p>
<p><b>See also </b><a href="qdate.html#day">day</a>() and <a href="qdate.html#dayOfWeek">dayOfWeek</a>().</p>
<!-- @@@dayOfYear -->
<!-- $$$daysInMonth[overload1]$$$daysInMonth -->
<h3 class="fn"><a name="daysInMonth"></a><span class="type">int</span> QDate::<span class="name">daysInMonth</span> () const</h3>
<p>Returns the number of days in the month (28 to 31) for this date.</p>
<p><b>See also </b><a href="qdate.html#day">day</a>() and <a href="qdate.html#daysInYear">daysInYear</a>().</p>
<!-- @@@daysInMonth -->
<!-- $$$daysInYear[overload1]$$$daysInYear -->
<h3 class="fn"><a name="daysInYear"></a><span class="type">int</span> QDate::<span class="name">daysInYear</span> () const</h3>
<p>Returns the number of days in the year (365 or 366) for this date.</p>
<p><b>See also </b><a href="qdate.html#day">day</a>() and <a href="qdate.html#daysInMonth">daysInMonth</a>().</p>
<!-- @@@daysInYear -->
<!-- $$$daysTo[overload1]$$$daysToconstQDate& -->
<h3 class="fn"><a name="daysTo"></a><span class="type">int</span> QDate::<span class="name">daysTo</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns the number of days from this date to <i>d</i> (which is negative if <i>d</i> is earlier than this date).</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qdate.html">QDate</a></span> d1(<span class="number">1995</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">17</span>);  <span class="comment">// May 17, 1995</span>
 <span class="type"><a href="qdate.html">QDate</a></span> d2(<span class="number">1995</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">20</span>);  <span class="comment">// May 20, 1995</span>
 d1<span class="operator">.</span>daysTo(d2);          <span class="comment">// returns 3</span>
 d2<span class="operator">.</span>daysTo(d1);          <span class="comment">// returns -3</span></pre>
<p><b>See also </b><a href="qdate.html#addDays">addDays</a>().</p>
<!-- @@@daysTo -->
<!-- $$$fromJulianDay[overload1]$$$fromJulianDayint -->
<h3 class="fn"><a name="fromJulianDay"></a><span class="type">QDate</span> QDate::<span class="name">fromJulianDay</span> ( <span class="type">int</span> <i>jd</i> )<tt> [static]</tt></h3>
<p>Converts the Julian day <i>jd</i> to a <a href="qdate.html">QDate</a>.</p>
<p><b>See also </b><a href="qdate.html#toJulianDay">toJulianDay</a>().</p>
<!-- @@@fromJulianDay -->
<!-- $$$fromString[overload1]$$$fromStringconstQString&Qt::DateFormat -->
<h3 class="fn"><a name="fromString"></a><span class="type">QDate</span> QDate::<span class="name">fromString</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>string</i>, <span class="type"><a href="qt.html#DateFormat-enum">Qt::DateFormat</a></span> <i>format</i> = Qt::TextDate )<tt> [static]</tt></h3>
<p>Returns the <a href="qdate.html">QDate</a> represented by the <i>string</i>, using the <i>format</i> given, or an invalid date if the string cannot be parsed.</p>
<p>Note for <a href="qt.html#DateFormat-enum">Qt::TextDate</a>: It is recommended that you use the English short month names (e.g&#x2e; &quot;Jan&quot;). Although localized month names can also be used, they depend on the user's locale settings.</p>
<!-- @@@fromString -->
<!-- $$$fromString$$$fromStringconstQString&constQString& -->
<h3 class="fn"><a name="fromString-2"></a><span class="type">QDate</span> QDate::<span class="name">fromString</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>string</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>format</i> )<tt> [static]</tt></h3>
<p>Returns the <a href="qdate.html">QDate</a> represented by the <i>string</i>, using the <i>format</i> given, or an invalid date if the string cannot be parsed.</p>
<p>These expressions may be used for the format:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Expression</th><th >Output</th></tr></thead>
<tr valign="top" class="odd"><td >d</td><td >The day as a number without a leading zero (1 to 31)</td></tr>
<tr valign="top" class="even"><td >dd</td><td >The day as a number with a leading zero (01 to 31)</td></tr>
<tr valign="top" class="odd"><td >ddd</td><td >The abbreviated localized day name (e.g&#x2e; 'Mon' to 'Sun'). Uses <a href="qdate.html#shortDayName">QDate::shortDayName</a>().</td></tr>
<tr valign="top" class="even"><td >dddd</td><td >The long localized day name (e.g&#x2e; 'Monday' to 'Sunday'). Uses <a href="qdate.html#longDayName">QDate::longDayName</a>().</td></tr>
<tr valign="top" class="odd"><td >M</td><td >The month as a number without a leading zero (1 to 12)</td></tr>
<tr valign="top" class="even"><td >MM</td><td >The month as a number with a leading zero (01 to 12)</td></tr>
<tr valign="top" class="odd"><td >MMM</td><td >The abbreviated localized month name (e.g&#x2e; 'Jan' to 'Dec'). Uses <a href="qdate.html#shortMonthName">QDate::shortMonthName</a>().</td></tr>
<tr valign="top" class="even"><td >MMMM</td><td >The long localized month name (e.g&#x2e; 'January' to 'December'). Uses <a href="qdate.html#longMonthName">QDate::longMonthName</a>().</td></tr>
<tr valign="top" class="odd"><td >yy</td><td >The year as two digit number (00 to 99)</td></tr>
<tr valign="top" class="even"><td >yyyy</td><td >The year as four digit number. If the year is negative, a minus sign is prepended in addition.</td></tr>
</table>
<p>All other input characters will be treated as text. Any sequence of characters that are enclosed in single quotes will also be treated as text and will not be used as an expression. For example:</p>
<pre class="cpp"> <span class="type"><a href="qdate.html">QDate</a></span> date <span class="operator">=</span> <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#fromString">fromString</a>(<span class="string">&quot;1MM12car2003&quot;</span><span class="operator">,</span> <span class="string">&quot;d'MM'MMcaryyyy&quot;</span>);
 <span class="comment">// date is 1 December 2003</span></pre>
<p>If the format is not satisfied, an invalid <a href="qdate.html">QDate</a> is returned. The expressions that don't expect leading zeroes (d, M) will be greedy. This means that they will use two digits even if this will put them outside the accepted range of values and leaves too few digits for other sections. For example, the following format string could have meant January 30 but the M will grab two digits, resulting in an invalid date:</p>
<pre class="cpp"> <span class="type"><a href="qdate.html">QDate</a></span> date <span class="operator">=</span> <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#fromString">fromString</a>(<span class="string">&quot;130&quot;</span><span class="operator">,</span> <span class="string">&quot;Md&quot;</span>); <span class="comment">// invalid</span></pre>
<p>For any field that is not represented in the format the following defaults are used:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Field</th><th >Default value</th></tr></thead>
<tr valign="top" class="odd"><td >Year</td><td >1900</td></tr>
<tr valign="top" class="even"><td >Month</td><td >1</td></tr>
<tr valign="top" class="odd"><td >Day</td><td >1</td></tr>
</table>
<p>The following examples demonstrate the default values:</p>
<pre class="cpp"> <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#fromString">fromString</a>(<span class="string">&quot;1.30&quot;</span><span class="operator">,</span> <span class="string">&quot;M.d&quot;</span>);           <span class="comment">// January 30 1900</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#fromString">fromString</a>(<span class="string">&quot;20000110&quot;</span><span class="operator">,</span> <span class="string">&quot;yyyyMMdd&quot;</span>);  <span class="comment">// January 10, 2000</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#fromString">fromString</a>(<span class="string">&quot;20000110&quot;</span><span class="operator">,</span> <span class="string">&quot;yyyyMd&quot;</span>);    <span class="comment">// January 10, 2000</span></pre>
<p><b>See also </b><a href="qdatetime.html#fromString">QDateTime::fromString</a>(), <a href="qtime.html#fromString">QTime::fromString</a>(), <a href="qdate.html#toString">QDate::toString</a>(), <a href="qdatetime.html#toString">QDateTime::toString</a>(), and <a href="qtime.html#toString">QTime::toString</a>().</p>
<!-- @@@fromString -->
<!-- $$$getDate[overload1]$$$getDateint*int*int* -->
<h3 class="fn"><a name="getDate"></a><span class="type">void</span> QDate::<span class="name">getDate</span> ( <span class="type">int</span> * <i>year</i>, <span class="type">int</span> * <i>month</i>, <span class="type">int</span> * <i>day</i> )</h3>
<p>Extracts the date's year, month, and day, and assigns them to *<i>year</i>, *<i>month</i>, and *<i>day</i>. The pointers may be null.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qdate.html#year">year</a>(), <a href="qdate.html#month">month</a>(), <a href="qdate.html#day">day</a>(), and <a href="qdate.html#isValid">isValid</a>().</p>
<!-- @@@getDate -->
<!-- $$$isLeapYear[overload1]$$$isLeapYearint -->
<h3 class="fn"><a name="isLeapYear"></a><span class="type">bool</span> QDate::<span class="name">isLeapYear</span> ( <span class="type">int</span> <i>year</i> )<tt> [static]</tt></h3>
<p>Returns true if the specified <i>year</i> is a leap year; otherwise returns false.</p>
<!-- @@@isLeapYear -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QDate::<span class="name">isNull</span> () const</h3>
<p>Returns true if the date is null; otherwise returns false. A null date is invalid.</p>
<p><b>Note:</b> The behavior of this function is equivalent to <a href="qdate.html#isValid">isValid</a>().</p>
<p><b>See also </b><a href="qdate.html#isValid">isValid</a>().</p>
<!-- @@@isNull -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QDate::<span class="name">isValid</span> () const</h3>
<p>Returns true if this date is valid; otherwise returns false.</p>
<p><b>See also </b><a href="qdate.html#isNull">isNull</a>().</p>
<!-- @@@isValid -->
<!-- $$$isValid$$$isValidintintint -->
<h3 class="fn"><a name="isValid-2"></a><span class="type">bool</span> QDate::<span class="name">isValid</span> ( <span class="type">int</span> <i>year</i>, <span class="type">int</span> <i>month</i>, <span class="type">int</span> <i>day</i> )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns true if the specified date (<i>year</i>, <i>month</i>, and <i>day</i>) is valid; otherwise returns false.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2002</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">17</span>);  <span class="comment">// true</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2002</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">30</span>);  <span class="comment">// false (Feb 30 does not exist)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2004</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// true (2004 is a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2000</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// true (2000 is a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2006</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// false (2006 is not a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2100</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// false (2100 is not a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">::</span><a href="qdate.html#isValid">isValid</a>(<span class="number">1202</span><span class="operator">,</span> <span class="number">6</span><span class="operator">,</span> <span class="number">6</span>);   <span class="comment">// true (even though 1202 is pre-Gregorian)</span></pre>
<p><b>See also </b><a href="qdate.html#isNull">isNull</a>() and <a href="qdate.html#setDate">setDate</a>().</p>
<!-- @@@isValid -->
<!-- $$$longDayName[overload1]$$$longDayNameint -->
<h3 class="fn"><a name="longDayName"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">longDayName</span> ( <span class="type">int</span> <i>weekday</i> )<tt> [static]</tt></h3>
<p>Returns the long version of the name of the <i>weekday</i>. The returned name is in normal type which can be used for date formatting.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>().</p>
<!-- @@@longDayName -->
<!-- $$$longDayName$$$longDayNameintMonthNameType -->
<h3 class="fn"><a name="longDayName-2"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">longDayName</span> ( <span class="type">int</span> <i>weekday</i>, <span class="type"><a href="qdate.html#MonthNameType-enum">MonthNameType</a></span> <i>type</i> )<tt> [static]</tt></h3>
<p>Returns the long name of the <i>weekday</i> for the representation specified by <i>type</i>.</p>
<p>The days are enumerated using the following convention:</p>
<ul>
<li>1 = &quot;Monday&quot;</li>
<li>2 = &quot;Tuesday&quot;</li>
<li>3 = &quot;Wednesday&quot;</li>
<li>4 = &quot;Thursday&quot;</li>
<li>5 = &quot;Friday&quot;</li>
<li>6 = &quot;Saturday&quot;</li>
<li>7 = &quot;Sunday&quot;</li>
</ul>
<p>The day names will be localized according to the system's default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>().</p>
<!-- @@@longDayName -->
<!-- $$$longMonthName[overload1]$$$longMonthNameint -->
<h3 class="fn"><a name="longMonthName"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">longMonthName</span> ( <span class="type">int</span> <i>month</i> )<tt> [static]</tt></h3>
<p>Returns the long version of the name of the <i>month</i>. The returned name is in normal type which can be used for date formatting.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>
<!-- @@@longMonthName -->
<!-- $$$longMonthName$$$longMonthNameintMonthNameType -->
<h3 class="fn"><a name="longMonthName-2"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">longMonthName</span> ( <span class="type">int</span> <i>month</i>, <span class="type"><a href="qdate.html#MonthNameType-enum">MonthNameType</a></span> <i>type</i> )<tt> [static]</tt></h3>
<p>Returns the long name of the <i>month</i> for the representation specified by <i>type</i>.</p>
<p>The months are enumerated using the following convention:</p>
<ul>
<li>1 = &quot;January&quot;</li>
<li>2 = &quot;February&quot;</li>
<li>3 = &quot;March&quot;</li>
<li>4 = &quot;April&quot;</li>
<li>5 = &quot;May&quot;</li>
<li>6 = &quot;June&quot;</li>
<li>7 = &quot;July&quot;</li>
<li>8 = &quot;August&quot;</li>
<li>9 = &quot;September&quot;</li>
<li>10 = &quot;October&quot;</li>
<li>11 = &quot;November&quot;</li>
<li>12 = &quot;December&quot;</li>
</ul>
<p>The month names will be localized according to the system's default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>
<!-- @@@longMonthName -->
<!-- $$$month[overload1]$$$month -->
<h3 class="fn"><a name="month"></a><span class="type">int</span> QDate::<span class="name">month</span> () const</h3>
<p>Returns the number corresponding to the month of this date, using the following convention:</p>
<ul>
<li>1 = &quot;January&quot;</li>
<li>2 = &quot;February&quot;</li>
<li>3 = &quot;March&quot;</li>
<li>4 = &quot;April&quot;</li>
<li>5 = &quot;May&quot;</li>
<li>6 = &quot;June&quot;</li>
<li>7 = &quot;July&quot;</li>
<li>8 = &quot;August&quot;</li>
<li>9 = &quot;September&quot;</li>
<li>10 = &quot;October&quot;</li>
<li>11 = &quot;November&quot;</li>
<li>12 = &quot;December&quot;</li>
</ul>
<p><b>See also </b><a href="qdate.html#year">year</a>() and <a href="qdate.html#day">day</a>().</p>
<!-- @@@month -->
<!-- $$$setDate[overload1]$$$setDateintintint -->
<h3 class="fn"><a name="setDate"></a><span class="type">bool</span> QDate::<span class="name">setDate</span> ( <span class="type">int</span> <i>year</i>, <span class="type">int</span> <i>month</i>, <span class="type">int</span> <i>day</i> )</h3>
<p>Sets the date's <i>year</i>, <i>month</i>, and <i>day</i>. Returns true if the date is valid; otherwise returns false.</p>
<p>If the specified date is invalid, the <a href="qdate.html">QDate</a> object is set to be invalid. Any date before 2 January 4713 B.C&#x2e; is considered invalid.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qdate.html#isValid">isValid</a>().</p>
<!-- @@@setDate -->
<!-- $$$shortDayName[overload1]$$$shortDayNameint -->
<h3 class="fn"><a name="shortDayName"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">shortDayName</span> ( <span class="type">int</span> <i>weekday</i> )<tt> [static]</tt></h3>
<p>Returns the short version of the name of the <i>weekday</i>. The returned name is in normal type which can be used for date formatting.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#longDayName">longDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>().</p>
<!-- @@@shortDayName -->
<!-- $$$shortDayName$$$shortDayNameintMonthNameType -->
<h3 class="fn"><a name="shortDayName-2"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">shortDayName</span> ( <span class="type">int</span> <i>weekday</i>, <span class="type"><a href="qdate.html#MonthNameType-enum">MonthNameType</a></span> <i>type</i> )<tt> [static]</tt></h3>
<p>Returns the short name of the <i>weekday</i> for the representation specified by <i>type</i>.</p>
<p>The days are enumerated using the following convention:</p>
<ul>
<li>1 = &quot;Mon&quot;</li>
<li>2 = &quot;Tue&quot;</li>
<li>3 = &quot;Wed&quot;</li>
<li>4 = &quot;Thu&quot;</li>
<li>5 = &quot;Fri&quot;</li>
<li>6 = &quot;Sat&quot;</li>
<li>7 = &quot;Sun&quot;</li>
</ul>
<p>The day names will be localized according to the system's default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), <a href="qdate.html#longMonthName">longMonthName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>
<!-- @@@shortDayName -->
<!-- $$$shortMonthName[overload1]$$$shortMonthNameint -->
<h3 class="fn"><a name="shortMonthName"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">shortMonthName</span> ( <span class="type">int</span> <i>month</i> )<tt> [static]</tt></h3>
<p>Returns the short version of the name of the <i>month</i>. The returned name is in normal type which can be used for date formatting.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#longMonthName">longMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>
<!-- @@@shortMonthName -->
<!-- $$$shortMonthName$$$shortMonthNameintMonthNameType -->
<h3 class="fn"><a name="shortMonthName-2"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">shortMonthName</span> ( <span class="type">int</span> <i>month</i>, <span class="type"><a href="qdate.html#MonthNameType-enum">MonthNameType</a></span> <i>type</i> )<tt> [static]</tt></h3>
<p>Returns the short name of the <i>month</i> for the representation specified by <i>type</i>.</p>
<p>The months are enumerated using the following convention:</p>
<ul>
<li>1 = &quot;Jan&quot;</li>
<li>2 = &quot;Feb&quot;</li>
<li>3 = &quot;Mar&quot;</li>
<li>4 = &quot;Apr&quot;</li>
<li>5 = &quot;May&quot;</li>
<li>6 = &quot;Jun&quot;</li>
<li>7 = &quot;Jul&quot;</li>
<li>8 = &quot;Aug&quot;</li>
<li>9 = &quot;Sep&quot;</li>
<li>10 = &quot;Oct&quot;</li>
<li>11 = &quot;Nov&quot;</li>
<li>12 = &quot;Dec&quot;</li>
</ul>
<p>The month names will be localized according to the system's default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qdate.html#toString">toString</a>(), <a href="qdate.html#longMonthName">longMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>
<!-- @@@shortMonthName -->
<!-- $$$toJulianDay[overload1]$$$toJulianDay -->
<h3 class="fn"><a name="toJulianDay"></a><span class="type">int</span> QDate::<span class="name">toJulianDay</span> () const</h3>
<p>Converts the date to a Julian day.</p>
<p><b>See also </b><a href="qdate.html#fromJulianDay">fromJulianDay</a>().</p>
<!-- @@@toJulianDay -->
<!-- $$$toString[overload1]$$$toStringconstQString& -->
<h3 class="fn"><a name="toString"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">toString</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>format</i> ) const</h3>
<p>Returns the date as a string. The <i>format</i> parameter determines the format of the result string.</p>
<p>These expressions may be used:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Expression</th><th >Output</th></tr></thead>
<tr valign="top" class="odd"><td >d</td><td >the day as number without a leading zero (1 to 31)</td></tr>
<tr valign="top" class="even"><td >dd</td><td >the day as number with a leading zero (01 to 31)</td></tr>
<tr valign="top" class="odd"><td >ddd</td><td >the abbreviated localized day name (e.g&#x2e; 'Mon' to 'Sun'). Uses <a href="qdate.html#shortDayName">QDate::shortDayName</a>().</td></tr>
<tr valign="top" class="even"><td >dddd</td><td >the long localized day name (e.g&#x2e; 'Monday' to 'Sunday'). Uses <a href="qdate.html#longDayName">QDate::longDayName</a>().</td></tr>
<tr valign="top" class="odd"><td >M</td><td >the month as number without a leading zero (1 to 12)</td></tr>
<tr valign="top" class="even"><td >MM</td><td >the month as number with a leading zero (01 to 12)</td></tr>
<tr valign="top" class="odd"><td >MMM</td><td >the abbreviated localized month name (e.g&#x2e; 'Jan' to 'Dec'). Uses <a href="qdate.html#shortMonthName">QDate::shortMonthName</a>().</td></tr>
<tr valign="top" class="even"><td >MMMM</td><td >the long localized month name (e.g&#x2e; 'January' to 'December'). Uses <a href="qdate.html#longMonthName">QDate::longMonthName</a>().</td></tr>
<tr valign="top" class="odd"><td >yy</td><td >the year as two digit number (00 to 99)</td></tr>
<tr valign="top" class="even"><td >yyyy</td><td >the year as four digit number. If the year is negative, a minus sign is prepended in addition.</td></tr>
</table>
<p>All other input characters will be ignored. Any sequence of characters that are enclosed in singlequotes will be treated as text and not be used as an expression. Two consecutive singlequotes (&quot;''&quot;) are replaced by a singlequote in the output.</p>
<p>Example format strings (assuming that the <a href="qdate.html">QDate</a> is the 20 July 1969):</p>
<table class="generic">
<thead><tr class="qt-style"><th >Format</th><th >Result</th></tr></thead>
<tr valign="top" class="odd"><td >dd.MM.yyyy</td><td >20.07.1969</td></tr>
<tr valign="top" class="even"><td >ddd MMMM d yy</td><td >Sun July 20 69</td></tr>
<tr valign="top" class="odd"><td >'The day is' dddd</td><td >The day is Sunday</td></tr>
</table>
<p>If the datetime is invalid, an empty string will be returned.</p>
<p><b>Warning:</b> The <a href="qt.html#DateFormat-enum">Qt::ISODate</a> format is only valid for years in the range 0 to 9999. This restriction may apply to locale-aware formats as well, depending on the locale settings.</p>
<p><b>See also </b><a href="qdatetime.html#toString">QDateTime::toString</a>() and <a href="qtime.html#toString">QTime::toString</a>().</p>
<!-- @@@toString -->
<!-- $$$toString$$$toStringQt::DateFormat -->
<h3 class="fn"><a name="toString-2"></a><span class="type"><a href="qstring.html">QString</a></span> QDate::<span class="name">toString</span> ( <span class="type"><a href="qt.html#DateFormat-enum">Qt::DateFormat</a></span> <i>format</i> = Qt::TextDate ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the date as a string. The <i>format</i> parameter determines the format of the string.</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt::TextDate</a>, the string is formatted in the default way. <a href="qdate.html#shortDayName">QDate::shortDayName</a>() and <a href="qdate.html#shortMonthName">QDate::shortMonthName</a>() are used to generate the string, so the day and month names will be localized names using the default locale from the system. An example of this formatting is &quot;Sat May 20 1995&quot;.</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt::ISODate</a>, the string format corresponds to the ISO 8601 extended specification for representations of dates and times, taking the form YYYY-MM-DD, where YYYY is the year, MM is the month of the year (between 01 and 12), and DD is the day of the month between 01 and 31.</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt::SystemLocaleShortDate</a> or <a href="qt.html#DateFormat-enum">Qt::SystemLocaleLongDate</a>, the string format depends on the locale settings of the system. Identical to calling <a href="qlocale.html#system">QLocale::system</a>().toString(date, <a href="qlocale.html#FormatType-enum">QLocale::ShortFormat</a>) or <a href="qlocale.html#system">QLocale::system</a>().toString(date, <a href="qlocale.html#FormatType-enum">QLocale::LongFormat</a>).</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt::DefaultLocaleShortDate</a> or <a href="qt.html#DateFormat-enum">Qt::DefaultLocaleLongDate</a>, the string format depends on the default application locale. This is the locale set with <a href="qlocale.html#setDefault">QLocale::setDefault</a>(), or the system locale if no default locale has been set. Identical to calling QLocale().toString(date, <a href="qlocale.html#FormatType-enum">QLocale::ShortFormat</a>) or QLocale().toString(date, <a href="qlocale.html#FormatType-enum">QLocale::LongFormat</a>).</p>
<p>If the date is invalid, an empty string will be returned.</p>
<p><b>Warning:</b> The <a href="qt.html#DateFormat-enum">Qt::ISODate</a> format is only valid for years in the range 0 to 9999. This restriction may apply to locale-aware formats as well, depending on the locale settings.</p>
<p><b>See also </b><a href="qdate.html#shortDayName">shortDayName</a>() and <a href="qdate.html#shortMonthName">shortMonthName</a>().</p>
<!-- @@@toString -->
<!-- $$$weekNumber[overload1]$$$weekNumberint* -->
<h3 class="fn"><a name="weekNumber"></a><span class="type">int</span> QDate::<span class="name">weekNumber</span> ( <span class="type">int</span> * <i>yearNumber</i> = 0 ) const</h3>
<p>Returns the week number (1 to 53), and stores the year in *<i>yearNumber</i> unless <i>yearNumber</i> is null (the default).</p>
<p>Returns 0 if the date is invalid.</p>
<p>In accordance with ISO 8601, weeks start on Monday and the first Thursday of a year is always in week 1 of that year. Most years have 52 weeks, but some have 53.</p>
<p>*<i>yearNumber</i> is not always the same as <a href="qdate.html#year">year</a>(). For example, 1 January 2000 has week number 52 in the year 1999, and 31 December 2002 has week number 1 in the year 2003.</p>
<p><b>See also </b><a href="qdate.html#isValid">isValid</a>().</p>
<!-- @@@weekNumber -->
<!-- $$$year[overload1]$$$year -->
<h3 class="fn"><a name="year"></a><span class="type">int</span> QDate::<span class="name">year</span> () const</h3>
<p>Returns the year of this date. Negative numbers indicate years before 1 A.D&#x2e; = 1 C.E&#x2e;, such that year -44 is 44 B.C&#x2e;</p>
<p><b>See also </b><a href="qdate.html#month">month</a>() and <a href="qdate.html#day">day</a>().</p>
<!-- @@@year -->
<!-- $$$operator!=[overload1]$$$operator!=constQDate& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QDate::<span class="name">operator!=</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns true if this date is different from <i>d</i>; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator<[overload1]$$$operator<constQDate& -->
<h3 class="fn"><a name="operator-lt"></a><span class="type">bool</span> QDate::<span class="name">operator&lt;</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns true if this date is earlier than <i>d</i>; otherwise returns false.</p>
<!-- @@@operator< -->
<!-- $$$operator<=[overload1]$$$operator<=constQDate& -->
<h3 class="fn"><a name="operator-lt-eq"></a><span class="type">bool</span> QDate::<span class="name">operator&lt;=</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns true if this date is earlier than or equal to <i>d</i>; otherwise returns false.</p>
<!-- @@@operator<= -->
<!-- $$$operator==[overload1]$$$operator==constQDate& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QDate::<span class="name">operator==</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns true if this date is equal to <i>d</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator>[overload1]$$$operator>constQDate& -->
<h3 class="fn"><a name="operator-gt"></a><span class="type">bool</span> QDate::<span class="name">operator&gt;</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns true if this date is later than <i>d</i>; otherwise returns false.</p>
<!-- @@@operator> -->
<!-- $$$operator>=[overload1]$$$operator>=constQDate& -->
<h3 class="fn"><a name="operator-gt-eq"></a><span class="type">bool</span> QDate::<span class="name">operator&gt;=</span> ( const <span class="type">QDate</span> &amp; <i>d</i> ) const</h3>
<p>Returns true if this date is later than or equal to <i>d</i>; otherwise returns false.</p>
<!-- @@@operator>= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<[overload1]$$$operator<<QDataStream&constQDate& -->
<h3 class="fn"><a name="operator-lt-lt"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>out</i>, const <span class="type">QDate</span> &amp; <i>date</i> )</h3>
<p>Writes the <i>date</i> to stream <i>out</i>.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QDate& -->
<h3 class="fn"><a name="operator-gt-gt"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>in</i>, <span class="type">QDate</span> &amp; <i>date</i> )</h3>
<p>Reads a date from stream <i>in</i> into the <i>date</i>.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>