Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5021

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: QDateTime 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>QDateTime</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-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>
<li class="level3"><a href="#use-of-system-timezone">Use of System Timezone</a></li>
<li class="level3"><a href="#daylight-savings-time-dst">Daylight Savings Time (DST)</a></li>
</ul>
</div>
<h1 class="title">QDateTime Class Reference</h1>
<!-- $$$QDateTime-brief -->
<p>The QDateTime class provides date and time functions. <a href="#details">More...</a></p>
<!-- @@@QDateTime -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDateTime&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="qdatetime-members.html">List of all members, including inherited members</a></li>
<li><a href="qdatetime-qt3.html">Qt 3 support members</a></li>
</ul>
<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="qdatetime.html#QDateTime">QDateTime</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#QDateTime-2">QDateTime</a></b> ( const QDate &amp; <i>date</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#QDateTime-3">QDateTime</a></b> ( const QDate &amp; <i>date</i>, const QTime &amp; <i>time</i>, Qt::TimeSpec <i>spec</i> = Qt::LocalTime )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#QDateTime-4">QDateTime</a></b> ( const QDateTime &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#dtor.QDateTime">~QDateTime</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#addDays">addDays</a></b> ( int <i>ndays</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#addMSecs">addMSecs</a></b> ( qint64 <i>msecs</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#addMonths">addMonths</a></b> ( int <i>nmonths</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#addSecs">addSecs</a></b> ( int <i>s</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#addYears">addYears</a></b> ( int <i>nyears</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDate </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#date">date</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#daysTo">daysTo</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#msecsTo">msecsTo</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#secsTo">secsTo</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#setDate">setDate</a></b> ( const QDate &amp; <i>date</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#setMSecsSinceEpoch">setMSecsSinceEpoch</a></b> ( qint64 <i>msecs</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#setTime">setTime</a></b> ( const QTime &amp; <i>time</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#setTimeSpec">setTimeSpec</a></b> ( Qt::TimeSpec <i>spec</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#setTime_t">setTime_t</a></b> ( uint <i>seconds</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#time">time</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::TimeSpec </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#timeSpec">timeSpec</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#toLocalTime">toLocalTime</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#toMSecsSinceEpoch">toMSecsSinceEpoch</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.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="qdatetime.html#toString-2">toString</a></b> ( Qt::DateFormat <i>format</i> = Qt::TextDate ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#toTimeSpec">toTimeSpec</a></b> ( Qt::TimeSpec <i>specification</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#toTime_t">toTime_t</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#toUTC">toUTC</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-not-eq">operator!=</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-lt">operator&lt;</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-lt-eq">operator&lt;=</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-eq">operator=</a></b> ( const QDateTime &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-eq-eq">operator==</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-gt">operator&gt;</a></b> ( const QDateTime &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-gt-eq">operator&gt;=</a></b> ( const QDateTime &amp; <i>other</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"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#currentDateTime">currentDateTime</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#currentDateTimeUtc">currentDateTimeUtc</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#currentMSecsSinceEpoch">currentMSecsSinceEpoch</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#fromMSecsSinceEpoch">fromMSecsSinceEpoch</a></b> ( qint64 <i>msecs</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.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"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.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"> QDateTime </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#fromTime_t">fromTime_t</a></b> ( uint <i>seconds</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="qdatetime.html#operator-lt-lt-4">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>out</i>, const QDateTime &amp; <i>dateTime</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdatetime.html#operator-gt-gt-3">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>in</i>, QDateTime &amp; <i>dateTime</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QDateTime-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDateTime class provides date and time functions.</p>
<p>A QDateTime object contains a calendar date and a clock time (a &quot;datetime&quot;). It is a combination of the <a href="qdate.html">QDate</a> and <a href="qtime.html">QTime</a> classes. It can read the current datetime from the system clock. It provides functions for comparing datetimes and for manipulating a datetime by adding a number of seconds, days, months, or years.</p>
<p>A QDateTime object is typically created either by giving a date and time explicitly in the constructor, or by using the static function <a href="qdatetime.html#currentDateTime">currentDateTime</a>() that returns a QDateTime object set to the system clock's time. The date and time can be changed with <a href="qdatetime.html#setDate">setDate</a>() and <a href="qdatetime.html#setTime">setTime</a>(). A datetime can also be set using the <a href="qdatetime.html#setTime_t">setTime_t</a>() function that takes a POSIX-standard &quot;number of seconds since 00:00:00 on January 1, 1970&quot; value. The <a href="qdatetime.html#fromString">fromString</a>() function returns a QDateTime, given a string and a date format used to interpret the date within the string.</p>
<p>The <a href="qdatetime.html#date">date</a>() and <a href="qdatetime.html#time">time</a>() functions provide access to the date and time parts of the datetime. The same information is provided in textual format by the <a href="qdatetime.html#toString">toString</a>() function.</p>
<p>QDateTime provides a full set of operators to compare two QDateTime objects where smaller means earlier and larger means later.</p>
<p>You can increment (or decrement) a datetime by a given number of milliseconds using <a href="qdatetime.html#addMSecs">addMSecs</a>(), seconds using <a href="qdatetime.html#addSecs">addSecs</a>(), or days using <a href="qdatetime.html#addDays">addDays</a>(). Similarly you can use <a href="qdatetime.html#addMonths">addMonths</a>() and <a href="qdatetime.html#addYears">addYears</a>(). The <a href="qdatetime.html#daysTo">daysTo</a>() function returns the number of days between two datetimes, <a href="qdatetime.html#secsTo">secsTo</a>() returns the number of seconds between two datetimes, and <a href="qdatetime.html#msecsTo">msecsTo</a>() returns the number of milliseconds between two datetimes.</p>
<p>QDateTime can store datetimes as <a href="qt.html#TimeSpec-enum">local time</a> or as <a href="qt.html#TimeSpec-enum">UTC</a>. <a href="qdatetime.html#currentDateTime">QDateTime::currentDateTime</a>() returns a QDateTime expressed as local time; use <a href="qdatetime.html#toUTC">toUTC</a>() to convert it to UTC. You can also use <a href="qdatetime.html#timeSpec">timeSpec</a>() to find out if a QDateTime object stores a UTC time or a local time. Operations such as <a href="qdatetime.html#addSecs">addSecs</a>() and <a href="qdatetime.html#secsTo">secsTo</a>() are aware of daylight saving time (DST).</p>
<p><b>Note:</b> QDateTime does not account for leap seconds.</p>
<a name="use-of-gregorian-and-julian-calendars"></a>
<a name="qdatetime-g-and-j"></a><a name="use-of-gregorian-and-julian-calendars"></a>
<h4>Use of Gregorian and Julian Calendars</h4>
<p><a href="qdate.html">QDate</a> 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 QDateTime 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). QDateTime 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 QDateTime's &quot;date holes&quot;. It is suitable for use in applications that must convert a QDateTime to a date in another calendar system, e.g&#x2e;, Hebrew, Islamic or Chinese.</p>
<p>The Gregorian calendar was introduced in different places around the world on different dates. QDateTime uses <a href="qdate.html">QDate</a> to store the date, so it uses the Gregorian calendar for all locales, beginning on the date 15 October 1582. For dates up to and including 4 October 1582, QDateTime uses the Julian calendar. This means there is a 10-day gap in the QDateTime calendar between the 4th and the 15th of October 1582. When you use QDateTime for dates in that epoch, the day after 4 October 1582 is 15 October 1582, and the dates in the gap are invalid.</p>
<a name="use-of-system-timezone"></a>
<h4>Use of System Timezone</h4>
<p>QDateTime uses the system's time zone information to determine the offset of local time from UTC. If the system is not configured correctly or not up-to-date, QDateTime will give wrong results as well.</p>
<a name="daylight-savings-time-dst"></a>
<h4>Daylight Savings Time (DST)</h4>
<p>QDateTime takes into account the system's time zone information when dealing with DST. On modern Unix systems, this means it applies the correct historical DST data whenever possible. On Windows and Windows CE, where the system doesn't support historical DST data, historical accuracy is not maintained with respect to DST.</p>
<p>The range of valid dates taking DST into account is 1970-01-01 to the present, and rules are in place for handling DST correctly until 2037-12-31, but these could change. For dates falling outside that range, QDateTime makes a <i>best guess</i> using the rules for year 1970 or 2037, but we can't guarantee accuracy. This means QDateTime doesn't take into account changes in a locale's time zone before 1970, even if the system's time zone database supports that information.</p>
</div>
<p><b>See also </b><a href="qdate.html">QDate</a>, <a href="qtime.html">QTime</a>, and <a href="qdatetimeedit.html">QDateTimeEdit</a>.</p>
<!-- @@@QDateTime -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDateTime[overload1]$$$QDateTime -->
<h3 class="fn"><a name="QDateTime"></a>QDateTime::<span class="name">QDateTime</span> ()</h3>
<p>Constructs a null datetime (i.e&#x2e; null date and null time). A null datetime is invalid, since the date is invalid.</p>
<p><b>See also </b><a href="qdatetime.html#isValid">isValid</a>().</p>
<!-- @@@QDateTime -->
<!-- $$$QDateTime$$$QDateTimeconstQDate& -->
<h3 class="fn"><a name="QDateTime-2"></a>QDateTime::<span class="name">QDateTime</span> ( const <span class="type"><a href="qdate.html">QDate</a></span> &amp; <i>date</i> )</h3>
<p>Constructs a datetime with the given <i>date</i>, a valid time(00:00:00.000), and sets the <a href="qdatetime.html#timeSpec">timeSpec</a>() to <a href="qt.html#TimeSpec-enum">Qt::LocalTime</a>.</p>
<!-- @@@QDateTime -->
<!-- $$$QDateTime$$$QDateTimeconstQDate&constQTime&Qt::TimeSpec -->
<h3 class="fn"><a name="QDateTime-3"></a>QDateTime::<span class="name">QDateTime</span> ( const <span class="type"><a href="qdate.html">QDate</a></span> &amp; <i>date</i>, const <span class="type"><a href="qtime.html">QTime</a></span> &amp; <i>time</i>, <span class="type"><a href="qt.html#TimeSpec-enum">Qt::TimeSpec</a></span> <i>spec</i> = Qt::LocalTime )</h3>
<p>Constructs a datetime with the given <i>date</i> and <i>time</i>, using the time specification defined by <i>spec</i>.</p>
<p>If <i>date</i> is valid and <i>time</i> is not, the time will be set to midnight.</p>
<!-- @@@QDateTime -->
<!-- $$$QDateTime$$$QDateTimeconstQDateTime& -->
<h3 class="fn"><a name="QDateTime-4"></a>QDateTime::<span class="name">QDateTime</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of the <i>other</i> datetime.</p>
<!-- @@@QDateTime -->
<!-- $$$~QDateTime[overload1]$$$~QDateTime -->
<h3 class="fn"><a name="dtor.QDateTime"></a>QDateTime::<span class="name">~QDateTime</span> ()</h3>
<p>Destroys the datetime.</p>
<!-- @@@~QDateTime -->
<!-- $$$addDays[overload1]$$$addDaysint -->
<h3 class="fn"><a name="addDays"></a><span class="type">QDateTime</span> QDateTime::<span class="name">addDays</span> ( <span class="type">int</span> <i>ndays</i> ) const</h3>
<p>Returns a <a href="qdatetime.html">QDateTime</a> object containing a datetime <i>ndays</i> days later than the datetime of this object (or earlier if <i>ndays</i> is negative).</p>
<p><b>See also </b><a href="qdatetime.html#daysTo">daysTo</a>(), <a href="qdatetime.html#addMonths">addMonths</a>(), <a href="qdatetime.html#addYears">addYears</a>(), and <a href="qdatetime.html#addSecs">addSecs</a>().</p>
<!-- @@@addDays -->
<!-- $$$addMSecs[overload1]$$$addMSecsqint64 -->
<h3 class="fn"><a name="addMSecs"></a><span class="type">QDateTime</span> QDateTime::<span class="name">addMSecs</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>msecs</i> ) const</h3>
<p>Returns a <a href="qdatetime.html">QDateTime</a> object containing a datetime <i>msecs</i> miliseconds later than the datetime of this object (or earlier if <i>msecs</i> is negative).</p>
<p><b>See also </b><a href="qdatetime.html#addSecs">addSecs</a>(), <a href="qdatetime.html#msecsTo">msecsTo</a>(), <a href="qdatetime.html#addDays">addDays</a>(), <a href="qdatetime.html#addMonths">addMonths</a>(), and <a href="qdatetime.html#addYears">addYears</a>().</p>
<!-- @@@addMSecs -->
<!-- $$$addMonths[overload1]$$$addMonthsint -->
<h3 class="fn"><a name="addMonths"></a><span class="type">QDateTime</span> QDateTime::<span class="name">addMonths</span> ( <span class="type">int</span> <i>nmonths</i> ) const</h3>
<p>Returns a <a href="qdatetime.html">QDateTime</a> object containing a datetime <i>nmonths</i> months later than the datetime of this object (or earlier if <i>nmonths</i> is negative).</p>
<p><b>See also </b><a href="qdatetime.html#daysTo">daysTo</a>(), <a href="qdatetime.html#addDays">addDays</a>(), <a href="qdatetime.html#addYears">addYears</a>(), and <a href="qdatetime.html#addSecs">addSecs</a>().</p>
<!-- @@@addMonths -->
<!-- $$$addSecs[overload1]$$$addSecsint -->
<h3 class="fn"><a name="addSecs"></a><span class="type">QDateTime</span> QDateTime::<span class="name">addSecs</span> ( <span class="type">int</span> <i>s</i> ) const</h3>
<p>Returns a <a href="qdatetime.html">QDateTime</a> object containing a datetime <i>s</i> seconds later than the datetime of this object (or earlier if <i>s</i> is negative).</p>
<p><b>See also </b><a href="qdatetime.html#addMSecs">addMSecs</a>(), <a href="qdatetime.html#secsTo">secsTo</a>(), <a href="qdatetime.html#addDays">addDays</a>(), <a href="qdatetime.html#addMonths">addMonths</a>(), and <a href="qdatetime.html#addYears">addYears</a>().</p>
<!-- @@@addSecs -->
<!-- $$$addYears[overload1]$$$addYearsint -->
<h3 class="fn"><a name="addYears"></a><span class="type">QDateTime</span> QDateTime::<span class="name">addYears</span> ( <span class="type">int</span> <i>nyears</i> ) const</h3>
<p>Returns a <a href="qdatetime.html">QDateTime</a> object containing a datetime <i>nyears</i> years later than the datetime of this object (or earlier if <i>nyears</i> is negative).</p>
<p><b>See also </b><a href="qdatetime.html#daysTo">daysTo</a>(), <a href="qdatetime.html#addDays">addDays</a>(), <a href="qdatetime.html#addMonths">addMonths</a>(), and <a href="qdatetime.html#addSecs">addSecs</a>().</p>
<!-- @@@addYears -->
<!-- $$$currentDateTime[overload1]$$$currentDateTime -->
<h3 class="fn"><a name="currentDateTime"></a><span class="type">QDateTime</span> QDateTime::<span class="name">currentDateTime</span> ()<tt> [static]</tt></h3>
<p>Returns the current datetime, as reported by the system clock, in the local time zone.</p>
<p><b>See also </b><a href="qdatetime.html#currentDateTimeUtc">currentDateTimeUtc</a>(), <a href="qdate.html#currentDate">QDate::currentDate</a>(), <a href="qtime.html#currentTime">QTime::currentTime</a>(), and <a href="qdatetime.html#toTimeSpec">toTimeSpec</a>().</p>
<!-- @@@currentDateTime -->
<!-- $$$currentDateTimeUtc[overload1]$$$currentDateTimeUtc -->
<h3 class="fn"><a name="currentDateTimeUtc"></a><span class="type">QDateTime</span> QDateTime::<span class="name">currentDateTimeUtc</span> ()<tt> [static]</tt></h3>
<p>Returns the current datetime, as reported by the system clock, in UTC.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qdatetime.html#currentDateTime">currentDateTime</a>(), <a href="qdate.html#currentDate">QDate::currentDate</a>(), <a href="qtime.html#currentTime">QTime::currentTime</a>(), and <a href="qdatetime.html#toTimeSpec">toTimeSpec</a>().</p>
<!-- @@@currentDateTimeUtc -->
<!-- $$$currentMSecsSinceEpoch[overload1]$$$currentMSecsSinceEpoch -->
<h3 class="fn"><a name="currentMSecsSinceEpoch"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QDateTime::<span class="name">currentMSecsSinceEpoch</span> ()<tt> [static]</tt></h3>
<p>Returns the number of milliseconds since 1970-01-01T00:00:00 Universal Coordinated Time. This number is like the POSIX time_t variable, but expressed in milliseconds instead.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qdatetime.html#currentDateTime">currentDateTime</a>(), <a href="qdatetime.html#currentDateTimeUtc">currentDateTimeUtc</a>(), <a href="qdatetime.html#toTime_t">toTime_t</a>(), and <a href="qdatetime.html#toTimeSpec">toTimeSpec</a>().</p>
<!-- @@@currentMSecsSinceEpoch -->
<!-- $$$date[overload1]$$$date -->
<h3 class="fn"><a name="date"></a><span class="type"><a href="qdate.html">QDate</a></span> QDateTime::<span class="name">date</span> () const</h3>
<p>Returns the date part of the datetime.</p>
<p><b>See also </b><a href="qdatetime.html#setDate">setDate</a>(), <a href="qdatetime.html#time">time</a>(), and <a href="qdatetime.html#timeSpec">timeSpec</a>().</p>
<!-- @@@date -->
<!-- $$$daysTo[overload1]$$$daysToconstQDateTime& -->
<h3 class="fn"><a name="daysTo"></a><span class="type">int</span> QDateTime::<span class="name">daysTo</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns the number of days from this datetime to the <i>other</i> datetime. If the <i>other</i> datetime is earlier than this datetime, the value returned is negative.</p>
<p><b>See also </b><a href="qdatetime.html#addDays">addDays</a>(), <a href="qdatetime.html#secsTo">secsTo</a>(), and <a href="qdatetime.html#msecsTo">msecsTo</a>().</p>
<!-- @@@daysTo -->
<!-- $$$fromMSecsSinceEpoch[overload1]$$$fromMSecsSinceEpochqint64 -->
<h3 class="fn"><a name="fromMSecsSinceEpoch"></a><span class="type">QDateTime</span> QDateTime::<span class="name">fromMSecsSinceEpoch</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>msecs</i> )<tt> [static]</tt></h3>
<p>Returns a datetime whose date and time are the number of milliseconds, <i>msecs</i>, that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (<a href="qt.html#TimeSpec-enum">Qt::UTC</a>). On systems that do not support time zones, the time will be set as if local time were <a href="qt.html#TimeSpec-enum">Qt::UTC</a>.</p>
<p>Note that there are possible values for <i>msecs</i> that lie outside the valid range of <a href="qdatetime.html">QDateTime</a>, both negative and positive. The behavior of this function is undefined for those values.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qdatetime.html#toTime_t">toTime_t</a>() and <a href="qdatetime.html#setTime_t">setTime_t</a>().</p>
<!-- @@@fromMSecsSinceEpoch -->
<!-- $$$fromString[overload1]$$$fromStringconstQString&Qt::DateFormat -->
<h3 class="fn"><a name="fromString"></a><span class="type">QDateTime</span> QDateTime::<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="qdatetime.html">QDateTime</a> represented by the <i>string</i>, using the <i>format</i> given, or an invalid datetime if this is not possible.</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">QDateTime</span> QDateTime::<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="qdatetime.html">QDateTime</a> represented by the <i>string</i>, using the <i>format</i> given, or an invalid datetime if the string cannot be parsed.</p>
<p>These expressions may be used for the date part of the format string:</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-12)</td></tr>
<tr valign="top" class="even"><td >MM</td><td >the month as number with a leading zero (01-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-99)</td></tr>
<tr valign="top" class="even"><td >yyyy</td><td >the year as four digit number</td></tr>
</table>
<p><b>Note:</b> Unlike the other version of this function, day and month names must be given in the user's local language. It is only possible to use the English names if the user's language is English.</p>
<p>These expressions may be used for the time part of the format string:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Expression</th><th >Output</th></tr></thead>
<tr valign="top" class="odd"><td >h</td><td >the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr>
<tr valign="top" class="even"><td >hh</td><td >the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr>
<tr valign="top" class="odd"><td >H</td><td >the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr>
<tr valign="top" class="even"><td >HH</td><td >the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr>
<tr valign="top" class="odd"><td >m</td><td >the minute without a leading zero (0 to 59)</td></tr>
<tr valign="top" class="even"><td >mm</td><td >the minute with a leading zero (00 to 59)</td></tr>
<tr valign="top" class="odd"><td >s</td><td >the second without a leading zero (0 to 59)</td></tr>
<tr valign="top" class="even"><td >ss</td><td >the second with a leading zero (00 to 59)</td></tr>
<tr valign="top" class="odd"><td >z</td><td >the milliseconds without leading zeroes (0 to 999)</td></tr>
<tr valign="top" class="even"><td >zzz</td><td >the milliseconds with leading zeroes (000 to 999)</td></tr>
<tr valign="top" class="odd"><td >AP or A</td><td >interpret as an AM/PM time. <i>AP</i> must be either &quot;AM&quot; or &quot;PM&quot;.</td></tr>
<tr valign="top" class="even"><td >ap or a</td><td >Interpret as an AM/PM time. <i>ap</i> must be either &quot;am&quot; or &quot;pm&quot;.</td></tr>
</table>
<p>All other input characters will be treated as text. Any sequence of characters that are enclosed in singlequotes will also be treated as text and not be used as an expression.</p>
<pre class="cpp"> <span class="type"><a href="qtime.html">QTime</a></span> time1 <span class="operator">=</span> <span class="type"><a href="qtime.html">QTime</a></span><span class="operator">::</span><a href="qdatetime.html#fromString">fromString</a>(<span class="string">&quot;131&quot;</span><span class="operator">,</span> <span class="string">&quot;HHh&quot;</span>);
 <span class="comment">// time1 is 13:00:00</span>
 <span class="type"><a href="qtime.html">QTime</a></span> time1 <span class="operator">=</span> <span class="type"><a href="qtime.html">QTime</a></span><span class="operator">::</span><a href="qdatetime.html#fromString">fromString</a>(<span class="string">&quot;1apA&quot;</span><span class="operator">,</span> <span class="string">&quot;1amAM&quot;</span>);
 <span class="comment">// time1 is 01:00:00</span>

 <span class="type"><a href="qdatetime.html">QDateTime</a></span> dateTime2 <span class="operator">=</span> <span class="type"><a href="qdatetime.html">QDateTime</a></span><span class="operator">::</span><a href="qdatetime.html#fromString">fromString</a>(<span class="string">&quot;M1d1y9800:01:02&quot;</span><span class="operator">,</span>
                                             <span class="string">&quot;'M'M'd'd'y'yyhh:mm:ss&quot;</span>);
 <span class="comment">// dateTime is 1 January 1998 00:01:02</span></pre>
<p>If the format is not satisfied an invalid <a href="qdatetime.html">QDateTime</a> is returned. The expressions that don't have leading zeroes (d, M, h, m, s, z) will be greedy. This means that they will use two digits even if this will put them outside the range and/or leave too few digits for other sections.</p>
<pre class="cpp"> <span class="type"><a href="qdatetime.html">QDateTime</a></span> dateTime <span class="operator">=</span> <span class="type"><a href="qdatetime.html">QDateTime</a></span><span class="operator">::</span><a href="qdatetime.html#fromString">fromString</a>(<span class="string">&quot;130&quot;</span><span class="operator">,</span> <span class="string">&quot;Mm&quot;</span>); <span class="comment">// invalid</span></pre>
<p>This could have meant 1 January 00:30.00 but the M will grab two digits.</p>
<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 (January)</td></tr>
<tr valign="top" class="odd"><td >Day</td><td >1</td></tr>
<tr valign="top" class="even"><td >Hour</td><td >0</td></tr>
<tr valign="top" class="odd"><td >Minute</td><td >0</td></tr>
<tr valign="top" class="even"><td >Second</td><td >0</td></tr>
</table>
<p>For example:</p>
<pre class="cpp"> <span class="type"><a href="qdatetime.html">QDateTime</a></span> dateTime <span class="operator">=</span> <span class="type"><a href="qdatetime.html">QDateTime</a></span><span class="operator">::</span><a href="qdatetime.html#fromString">fromString</a>(<span class="string">&quot;1.30.1&quot;</span><span class="operator">,</span> <span class="string">&quot;M.d.s&quot;</span>);
 <span class="comment">// dateTime is January 30 in 1900 at 00:00:01.</span></pre>
<p><a href="qdatetime.html#toString">QDateTime::toString</a>() <a href="qtime.html#toString">QTime::toString</a>()</p>
<p><b>See also </b><a href="qdate.html#fromString">QDate::fromString</a>(), <a href="qtime.html#fromString">QTime::fromString</a>(), and <a href="qdate.html#toString">QDate::toString</a>().</p>
<!-- @@@fromString -->
<!-- $$$fromTime_t[overload1]$$$fromTime_tuint -->
<h3 class="fn"><a name="fromTime_t"></a><span class="type">QDateTime</span> QDateTime::<span class="name">fromTime_t</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>seconds</i> )<tt> [static]</tt></h3>
<p>Returns a datetime whose date and time are the number of <i>seconds</i> that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (<a href="qt.html#TimeSpec-enum">Qt::UTC</a>). On systems that do not support time zones, the time will be set as if local time were <a href="qt.html#TimeSpec-enum">Qt::UTC</a>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qdatetime.html#toTime_t">toTime_t</a>() and <a href="qdatetime.html#setTime_t">setTime_t</a>().</p>
<!-- @@@fromTime_t -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QDateTime::<span class="name">isNull</span> () const</h3>
<p>Returns true if both the date and the time are null; otherwise returns false. A null datetime is invalid.</p>
<p><b>See also </b><a href="qdate.html#isNull">QDate::isNull</a>(), <a href="qtime.html#isNull">QTime::isNull</a>(), and <a href="qdatetime.html#isValid">isValid</a>().</p>
<!-- @@@isNull -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QDateTime::<span class="name">isValid</span> () const</h3>
<p>Returns true if both the date and the time are valid; otherwise returns false.</p>
<p><b>See also </b><a href="qdate.html#isValid">QDate::isValid</a>() and <a href="qtime.html#isValid">QTime::isValid</a>().</p>
<!-- @@@isValid -->
<!-- $$$msecsTo[overload1]$$$msecsToconstQDateTime& -->
<h3 class="fn"><a name="msecsTo"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QDateTime::<span class="name">msecsTo</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns the number of milliseconds from this datetime to the <i>other</i> datetime. If the <i>other</i> datetime is earlier than this datetime, the value returned is negative.</p>
<p>Before performing the comparison, the two datetimes are converted to <a href="qt.html#TimeSpec-enum">Qt::UTC</a> to ensure that the result is correct if one of the two datetimes has daylight saving time (DST) and the other doesn't.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qdatetime.html#addMSecs">addMSecs</a>(), <a href="qdatetime.html#daysTo">daysTo</a>(), and <a href="qtime.html#msecsTo">QTime::msecsTo</a>().</p>
<!-- @@@msecsTo -->
<!-- $$$secsTo[overload1]$$$secsToconstQDateTime& -->
<h3 class="fn"><a name="secsTo"></a><span class="type">int</span> QDateTime::<span class="name">secsTo</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns the number of seconds from this datetime to the <i>other</i> datetime. If the <i>other</i> datetime is earlier than this datetime, the value returned is negative.</p>
<p>Before performing the comparison, the two datetimes are converted to <a href="qt.html#TimeSpec-enum">Qt::UTC</a> to ensure that the result is correct if one of the two datetimes has daylight saving time (DST) and the other doesn't.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qdatetime.html">QDateTime</a></span> now <span class="operator">=</span> <span class="type"><a href="qdatetime.html">QDateTime</a></span><span class="operator">::</span><a href="qdatetime.html#currentDateTime">currentDateTime</a>();
 <span class="type"><a href="qdatetime.html">QDateTime</a></span> xmas(<span class="type"><a href="qdate.html">QDate</a></span>(now<span class="operator">.</span>date()<span class="operator">.</span>year()<span class="operator">,</span> <span class="number">12</span><span class="operator">,</span> <span class="number">25</span>)<span class="operator">,</span> <span class="type"><a href="qtime.html">QTime</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
 <a href="qtglobal.html#qDebug">qDebug</a>(<span class="string">&quot;There are %d seconds to Christmas&quot;</span><span class="operator">,</span> now<span class="operator">.</span>secsTo(xmas));</pre>
<p><b>See also </b><a href="qdatetime.html#addSecs">addSecs</a>(), <a href="qdatetime.html#daysTo">daysTo</a>(), and <a href="qtime.html#secsTo">QTime::secsTo</a>().</p>
<!-- @@@secsTo -->
<!-- $$$setDate[overload1]$$$setDateconstQDate& -->
<h3 class="fn"><a name="setDate"></a><span class="type">void</span> QDateTime::<span class="name">setDate</span> ( const <span class="type"><a href="qdate.html">QDate</a></span> &amp; <i>date</i> )</h3>
<p>Sets the date part of this datetime to <i>date</i>. If no time is set, it is set to midnight.</p>
<p><b>See also </b><a href="qdatetime.html#date">date</a>(), <a href="qdatetime.html#setTime">setTime</a>(), and <a href="qdatetime.html#setTimeSpec">setTimeSpec</a>().</p>
<!-- @@@setDate -->
<!-- $$$setMSecsSinceEpoch[overload1]$$$setMSecsSinceEpochqint64 -->
<h3 class="fn"><a name="setMSecsSinceEpoch"></a><span class="type">void</span> QDateTime::<span class="name">setMSecsSinceEpoch</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>msecs</i> )</h3>
<p>Sets the date and time given the number of milliseconds,<i>msecs</i>, that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (<a href="qt.html#TimeSpec-enum">Qt::UTC</a>). On systems that do not support time zones this function will behave as if local time were <a href="qt.html#TimeSpec-enum">Qt::UTC</a>.</p>
<p>Note that there are possible values for <i>msecs</i> that lie outside the valid range of <a href="qdatetime.html">QDateTime</a>, both negative and positive. The behavior of this function is undefined for those values.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qdatetime.html#toMSecsSinceEpoch">toMSecsSinceEpoch</a>() and <a href="qdatetime.html#setTime_t">setTime_t</a>().</p>
<!-- @@@setMSecsSinceEpoch -->
<!-- $$$setTime[overload1]$$$setTimeconstQTime& -->
<h3 class="fn"><a name="setTime"></a><span class="type">void</span> QDateTime::<span class="name">setTime</span> ( const <span class="type"><a href="qtime.html">QTime</a></span> &amp; <i>time</i> )</h3>
<p>Sets the time part of this datetime to <i>time</i>.</p>
<p><b>See also </b><a href="qdatetime.html#time">time</a>(), <a href="qdatetime.html#setDate">setDate</a>(), and <a href="qdatetime.html#setTimeSpec">setTimeSpec</a>().</p>
<!-- @@@setTime -->
<!-- $$$setTimeSpec[overload1]$$$setTimeSpecQt::TimeSpec -->
<h3 class="fn"><a name="setTimeSpec"></a><span class="type">void</span> QDateTime::<span class="name">setTimeSpec</span> ( <span class="type"><a href="qt.html#TimeSpec-enum">Qt::TimeSpec</a></span> <i>spec</i> )</h3>
<p>Sets the time specification used in this datetime to <i>spec</i>.</p>
<p><b>See also </b><a href="qdatetime.html#timeSpec">timeSpec</a>(), <a href="qdatetime.html#setDate">setDate</a>(), <a href="qdatetime.html#setTime">setTime</a>(), and <a href="qt.html#TimeSpec-enum">Qt::TimeSpec</a>.</p>
<!-- @@@setTimeSpec -->
<!-- $$$setTime_t[overload1]$$$setTime_tuint -->
<h3 class="fn"><a name="setTime_t"></a><span class="type">void</span> QDateTime::<span class="name">setTime_t</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>seconds</i> )</h3>
<p>Sets the date and time given the number of <i>seconds</i> that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (<a href="qt.html#TimeSpec-enum">Qt::UTC</a>). On systems that do not support time zones this function will behave as if local time were <a href="qt.html#TimeSpec-enum">Qt::UTC</a>.</p>
<p><b>See also </b><a href="qdatetime.html#toTime_t">toTime_t</a>().</p>
<!-- @@@setTime_t -->
<!-- $$$time[overload1]$$$time -->
<h3 class="fn"><a name="time"></a><span class="type"><a href="qtime.html">QTime</a></span> QDateTime::<span class="name">time</span> () const</h3>
<p>Returns the time part of the datetime.</p>
<p><b>See also </b><a href="qdatetime.html#setTime">setTime</a>(), <a href="qdatetime.html#date">date</a>(), and <a href="qdatetime.html#timeSpec">timeSpec</a>().</p>
<!-- @@@time -->
<!-- $$$timeSpec[overload1]$$$timeSpec -->
<h3 class="fn"><a name="timeSpec"></a><span class="type"><a href="qt.html#TimeSpec-enum">Qt::TimeSpec</a></span> QDateTime::<span class="name">timeSpec</span> () const</h3>
<p>Returns the time specification of the datetime.</p>
<p><b>See also </b><a href="qdatetime.html#setTimeSpec">setTimeSpec</a>(), <a href="qdatetime.html#date">date</a>(), <a href="qdatetime.html#time">time</a>(), and <a href="qt.html#TimeSpec-enum">Qt::TimeSpec</a>.</p>
<!-- @@@timeSpec -->
<!-- $$$toLocalTime[overload1]$$$toLocalTime -->
<h3 class="fn"><a name="toLocalTime"></a><span class="type">QDateTime</span> QDateTime::<span class="name">toLocalTime</span> () const</h3>
<p>Returns a datetime containing the date and time information in this datetime, but specified using the <a href="qt.html#TimeSpec-enum">Qt::LocalTime</a> definition.</p>
<p><b>See also </b><a href="qdatetime.html#toTimeSpec">toTimeSpec</a>().</p>
<!-- @@@toLocalTime -->
<!-- $$$toMSecsSinceEpoch[overload1]$$$toMSecsSinceEpoch -->
<h3 class="fn"><a name="toMSecsSinceEpoch"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QDateTime::<span class="name">toMSecsSinceEpoch</span> () const</h3>
<p>Returns the datetime as the number of milliseconds that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (<a href="qt.html#TimeSpec-enum">Qt::UTC</a>).</p>
<p>On systems that do not support time zones, this function will behave as if local time were <a href="qt.html#TimeSpec-enum">Qt::UTC</a>.</p>
<p>The behavior for this function is undefined if the datetime stored in this object is not valid. However, for all valid dates, this function returns a unique value.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qdatetime.html#toTime_t">toTime_t</a>() and <a href="qdatetime.html#setMSecsSinceEpoch">setMSecsSinceEpoch</a>().</p>
<!-- @@@toMSecsSinceEpoch -->
<!-- $$$toString[overload1]$$$toStringconstQString& -->
<h3 class="fn"><a name="toString"></a><span class="type"><a href="qstring.html">QString</a></span> QDateTime::<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 datetime as a string. The <i>format</i> parameter determines the format of the result string.</p>
<p>These expressions may be used for the date:</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 '<a href="qt.html#DayOfWeek-enum">Qt::Sunday</a>'). 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-12)</td></tr>
<tr valign="top" class="even"><td >MM</td><td >the month as number with a leading zero (01-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-99)</td></tr>
<tr valign="top" class="even"><td >yyyy</td><td >the year as four digit number</td></tr>
</table>
<p>These expressions may be used for the time:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Expression</th><th >Output</th></tr></thead>
<tr valign="top" class="odd"><td >h</td><td >the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr>
<tr valign="top" class="even"><td >hh</td><td >the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr>
<tr valign="top" class="odd"><td >m</td><td >the minute without a leading zero (0 to 59)</td></tr>
<tr valign="top" class="even"><td >mm</td><td >the minute with a leading zero (00 to 59)</td></tr>
<tr valign="top" class="odd"><td >s</td><td >the second without a leading zero (0 to 59)</td></tr>
<tr valign="top" class="even"><td >ss</td><td >the second with a leading zero (00 to 59)</td></tr>
<tr valign="top" class="odd"><td >z</td><td >the milliseconds without leading zeroes (0 to 999)</td></tr>
<tr valign="top" class="even"><td >zzz</td><td >the milliseconds with leading zeroes (000 to 999)</td></tr>
<tr valign="top" class="odd"><td >AP</td><td >use AM/PM display. <i>AP</i> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</td></tr>
<tr valign="top" class="even"><td >ap</td><td >use am/pm display. <i>ap</i> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</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 (assumed that the <a href="qdatetime.html">QDateTime</a> is 21 May 2001 14:13:09):</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 >21.05.2001</td></tr>
<tr valign="top" class="even"><td >ddd MMMM d yy</td><td >Tue May 21 01</td></tr>
<tr valign="top" class="odd"><td >hh:mm:ss.zzz</td><td >14:13:09.042</td></tr>
<tr valign="top" class="even"><td >h:m:s ap</td><td >2:13:9 pm</td></tr>
</table>
<p>If the datetime is invalid, an empty string will be returned.</p>
<p><b>See also </b><a href="qdate.html#toString">QDate::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> QDateTime::<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 datetime as a string in the <i>format</i> given.</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>(), <a href="qdate.html#shortMonthName">QDate::shortMonthName</a>(), and <a href="qtime.html#toString">QTime::toString</a>() are used to generate the string, so the day and month names will be localized names. An example of this formatting is &quot;Wed May 20 03:40:13 1998&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-DDTHH:mm:ss[Z|[+|-]HH:mm], depending on the <a href="qdatetime.html#timeSpec">timeSpec</a>() of the <a href="qdatetime.html">QDateTime</a>. If the <a href="qdatetime.html#timeSpec">timeSpec</a>() is <a href="qt.html#TimeSpec-enum">Qt::UTC</a>, Z will be appended to the string; if the <a href="qdatetime.html#timeSpec">timeSpec</a>() is <a href="qt.html#TimeSpec-enum">Qt::OffsetFromUTC</a> the offset in hours and minutes from UTC will be appended to the string.</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(datetime, <a href="qlocale.html#FormatType-enum">QLocale::ShortFormat</a>) or <a href="qlocale.html#system">QLocale::system</a>().toString(datetime, <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(datetime, <a href="qlocale.html#FormatType-enum">QLocale::ShortFormat</a>) or QLocale().toString(datetime, <a href="qlocale.html#FormatType-enum">QLocale::LongFormat</a>).</p>
<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="qdate.html#toString">QDate::toString</a>(), <a href="qtime.html#toString">QTime::toString</a>(), and <a href="qt.html#DateFormat-enum">Qt::DateFormat</a>.</p>
<!-- @@@toString -->
<!-- $$$toTimeSpec[overload1]$$$toTimeSpecQt::TimeSpec -->
<h3 class="fn"><a name="toTimeSpec"></a><span class="type">QDateTime</span> QDateTime::<span class="name">toTimeSpec</span> ( <span class="type"><a href="qt.html#TimeSpec-enum">Qt::TimeSpec</a></span> <i>specification</i> ) const</h3>
<p>Returns a copy of this datetime configured to use the given time <i>specification</i>.</p>
<p><b>See also </b><a href="qdatetime.html#timeSpec">timeSpec</a>(), <a href="qdatetime.html#toUTC">toUTC</a>(), and <a href="qdatetime.html#toLocalTime">toLocalTime</a>().</p>
<!-- @@@toTimeSpec -->
<!-- $$$toTime_t[overload1]$$$toTime_t -->
<h3 class="fn"><a name="toTime_t"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> QDateTime::<span class="name">toTime_t</span> () const</h3>
<p>Returns the datetime as the number of seconds that have passed since 1970-01-01T00:00:00, Coordinated Universal Time (<a href="qt.html#TimeSpec-enum">Qt::UTC</a>).</p>
<p>On systems that do not support time zones, this function will behave as if local time were <a href="qt.html#TimeSpec-enum">Qt::UTC</a>.</p>
<p><b>Note:</b> This function returns a 32-bit unsigned integer, so it does not support dates before 1970, but it does support dates after 2038-01-19T03:14:06, which may not be valid time_t values. Be careful when passing those time_t values to system functions, which could interpret them as negative dates.</p>
<p>If the date is outside the range 1970-01-01T00:00:00 to 2106-02-07T06:28:14, this function returns -1 cast to an unsigned integer (i.e&#x2e;, 0xFFFFFFFF).</p>
<p>To get an extended range, use <a href="qdatetime.html#toMSecsSinceEpoch">toMSecsSinceEpoch</a>().</p>
<p><b>See also </b><a href="qdatetime.html#toMSecsSinceEpoch">toMSecsSinceEpoch</a>() and <a href="qdatetime.html#setTime_t">setTime_t</a>().</p>
<!-- @@@toTime_t -->
<!-- $$$toUTC[overload1]$$$toUTC -->
<h3 class="fn"><a name="toUTC"></a><span class="type">QDateTime</span> QDateTime::<span class="name">toUTC</span> () const</h3>
<p>Returns a datetime containing the date and time information in this datetime, but specified using the <a href="qt.html#TimeSpec-enum">Qt::UTC</a> definition.</p>
<p><b>See also </b><a href="qdatetime.html#toTimeSpec">toTimeSpec</a>().</p>
<!-- @@@toUTC -->
<!-- $$$operator!=[overload1]$$$operator!=constQDateTime& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QDateTime::<span class="name">operator!=</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns true if this datetime is different from the <i>other</i> datetime; otherwise returns false.</p>
<p>Two datetimes are different if either the date, the time, or the time zone components are different.</p>
<p><b>See also </b><a href="qdatetime.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator<[overload1]$$$operator<constQDateTime& -->
<h3 class="fn"><a name="operator-lt"></a><span class="type">bool</span> QDateTime::<span class="name">operator&lt;</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns true if this datetime is earlier than the <i>other</i> datetime; otherwise returns false.</p>
<!-- @@@operator< -->
<!-- $$$operator<=[overload1]$$$operator<=constQDateTime& -->
<h3 class="fn"><a name="operator-lt-eq"></a><span class="type">bool</span> QDateTime::<span class="name">operator&lt;=</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns true if this datetime is earlier than or equal to the <i>other</i> datetime; otherwise returns false.</p>
<!-- @@@operator<= -->
<!-- $$$operator=[overload1]$$$operator=constQDateTime& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QDateTime</span> &amp; QDateTime::<span class="name">operator=</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> )</h3>
<p>Makes a copy of the <i>other</i> datetime and returns a reference to the copy.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQDateTime& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QDateTime::<span class="name">operator==</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns true if this datetime is equal to the <i>other</i> datetime; otherwise returns false.</p>
<p><b>See also </b><a href="qdatetime.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
<!-- $$$operator>[overload1]$$$operator>constQDateTime& -->
<h3 class="fn"><a name="operator-gt"></a><span class="type">bool</span> QDateTime::<span class="name">operator&gt;</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns true if this datetime is later than the <i>other</i> datetime; otherwise returns false.</p>
<!-- @@@operator> -->
<!-- $$$operator>=[overload1]$$$operator>=constQDateTime& -->
<h3 class="fn"><a name="operator-gt-eq"></a><span class="type">bool</span> QDateTime::<span class="name">operator&gt;=</span> ( const <span class="type">QDateTime</span> &amp; <i>other</i> ) const</h3>
<p>Returns true if this datetime is later than or equal to the <i>other</i> datetime; otherwise returns false.</p>
<!-- @@@operator>= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDataStream&constQDateTime& -->
<h3 class="fn"><a name="operator-lt-lt-4"></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">QDateTime</span> &amp; <i>dateTime</i> )</h3>
<p>Writes <i>dateTime</i> to the <i>out</i> stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>$$$operator>>QDataStream&QDateTime& -->
<h3 class="fn"><a name="operator-gt-gt-3"></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">QDateTime</span> &amp; <i>dateTime</i> )</h3>
<p>Reads a datetime from the stream <i>in</i> into <i>dateTime</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>