Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 41640b7d04ef5b5040e7668305a5ba3d > files > 301

python-kde4-doc-4.11.4-1.mga4.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title>KDateTime</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <link rel="stylesheet" type="text/css" href="../common/doxygen.css" />
  <link rel="stylesheet" media="screen" type="text/css" title="KDE Colors" href="../common/kde.css" />
</head>
<body>
<div id="container">
<div id="header">
  <div id="header_top">
    <div>
      <div>
        <img alt ="" src="../common/top-kde.jpg"/>
        KDE 4.9 PyKDE API Reference
      </div>
    </div>
  </div>
  <div id="header_bottom">
    <div id="location">
      <ul>
        <li>KDE's Python API</li>
      </ul>
    </div>

    <div id="menu">
      <ul>
        <li><a href="../modules.html">Overview</a></li>
<li><a href="http://techbase.kde.org/Development/Languages/Python">PyKDE Home</a></li>
<li><a href="http://kde.org/family/">Sitemap</a></li>
<li><a href="http://kde.org/contact/">Contact Us</a></li>
</ul>
    </div>
  </div>
</div>

<div id="body_wrapper">
<div id="body">
<div id="right">
<div class="content">
<div id="main">
<div class="clearer">&nbsp;</div>

<h1>KDateTime Class Reference</h1>
<code>from PyKDE4.kdecore import *</code>
<p>



<h2>Detailed Description</h2>

<p>A class representing a date and time with an associated time zone
</p>
<p>
Topics:
- intro
- manipulation
- compatibility
</p>
<p>
<b>Introduction </b>
</p>
<p>
The class KDateTime combines a date and time with support for an
associated time zone or UTC offset. When manipulating KDateTime objects,
their time zones or UTC offsets are automatically taken into account. KDateTime
can also be set to represent a date-only value with no associated time.
</p>
<p>
The class uses QDateTime internally to represent date/time values, and
therefore uses the Gregorian calendar for dates starting from 15 October 1582,
and the Julian calendar for dates up to 4 October 1582. The minimum year
number is -4712 (4713 BC), while the upper limit is more than 11,000,000. The
actual adoption of the Gregorian calendar after 1582 was slow; the last European
country to adopt it, Greece, did so only in 1923. See QDateTime Considerations
section below for further discussion of the date range limitations.
</p>
<p>
The time specification types which KDateTime supports are:
- the UTC time zone
- a local time with a specified offset from UTC
- a local time in a specified time zone
- a local time using the current system time zone (a special case of the
previous item)
- local clock time, using whatever the local system clock says on whichever
computer it happens to be on. In this case, the equivalent UTC time will
vary depending on system. As a result, calculations involving local clock
times do not necessarily produce reliable results.
</p>
<p>
These characteristics are more fully described in the description of the
SpecType enumeration. Also see
<a href="http://www.w3.org/TR/timezone/">W3C: Working with Time Zones</a>
for a good overview of the different ways of representing times.
</p>
<p>
To set the time specification, use one of the setTimeSpec() methods, to get
the time specification, call timeSpec(), isUtc(), isLocalZone(),
isOffsetFromUtc() or isClockTime(). To determine whether two KDateTime
instances have the same time specification, call timeSpec() on each and
compare the returned values using KDateTime.Spec.operator==().
</p>
<p>
<b>Date and Time Manipulation </b>
</p>
<p>
A KDateTime object can be created by passing a date and time in its
constructor, together with a time specification.
</p>
<p>
If both the date and time are null, isNull() returns true. If the date, time
and time specification are all valid, isValid() returns true.
</p>
<p>
A KDateTime object can be converted to a different time specification by
using toUtc(), toLocalZone() or toClockTime(). It can be converted to a
specific time zone by toZone(). To return the time as an elapsed time since
1 January 1970 (as used by time(2)), use toTime_t(). The results of time
zone conversions are cached to minimize the need for recalculation. Each
KDateTime object caches its UTC equivalent and the last time zone
conversion performed.
</p>
<p>
The date and time can be set either in the constructor, or afterwards by
calling setDate(), setTime() or setDateTime(). To return the date and/or
time components of the KDateTime, use date(), time() and dateTime(). You
can determine whether the KDateTime represents a date and time, or a date
only, by isDateOnly(). You can change between a date and time or a date only
value using setDateOnly().
</p>
<p>
You can increment or decrement the date/time using addSecs(), addDays(),
addMonths() and addYears(). The interval between two date/time values can
be found using secsTo() or daysTo().
</p>
<p>
The comparison operators (operator==(), operator&lt;(), etc.) all take the time
zone properly into account; if the two KDateTime objects have different time
zones, they are first converted to UTC before the comparison is
performed. An alternative to the comparison operators is compare() which will
in addition tell you if a KDateTime object overlaps with another when one or
both are date-only values.
</p>
<p>
KDateTime values may be converted to and from a string representation using
the toString() and fromString() methods. These handle a variety of text
formats including ISO 8601 and RFC 2822.
</p>
<p>
KDateTime uses Qt's facilities to implicitly share data. Copying instances
is very efficient, and copied instances share cached UTC and time zone
conversions even after the copy is performed. A separate copy of the data is
created whenever a non-const method is called. If you want to force the
creation of a separate copy of the data (e.g. if you want two copies to
cache different time zone conversions), call detach().
</p>
<p>
<b>QDateTime Considerations </b>
</p>
<p>
KDateTime's interface is designed to be as compatible as possible with that
of QDateTime, but with adjustments to cater for time zone handling. Because
QDateTime lacks virtual methods, KDateTime is not inherited from QDateTime,
but instead is implemented using a private QDateTime object.
</p>
<p>
The date range restriction due to the use of QDateTime internally may at
first sight seem a design limitation. However, two factors should be
considered:
</p>
<p>
- there are significant problems in the representation of dates before the
Gregorian calendar was adopted. The date of adoption of the Gregorian
calendar varied from place to place, and in the Julian calendar the
date of the new year varied so that in different places the year number
could differ by one. So any date/time system which attempted to represent
dates as actually used in history would be too specialized to belong to
the core KDE libraries. Date/time systems for scientific applications can
be much simpler, but may differ from historical records.
</p>
<p>
- time zones were not invented until the middle of the 19th century. Before
that, solar time was used.
</p>
<p>
Because of these issues, together with the fact that KDateTime's aim is to
provide automatic time zone handling for date/time values, QDateTime was
chosen as the basis for KDateTime. For those who need an extended date
range, other classes exist.
</p>
<p>
<b>Simulation Facility </b>
</p>
<p>
This class provides a facility to simulate the local system time, which
affects all functions using or returning the system time. This facility is
provided for testing purposes only, and is only available if the library is
compiled with debug enabled. In release mode, simulation is inoperative and
the real local system time is used at all times. Use
setSimulatedSystemTime() to set or clear the simulated time. To read the
real (not simulated) system time, use realCurrentLocalDateTime().
</p>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd> KTimeZone, KSystemTimeZones, QDateTime, QDate, QTime
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> <a href="http://www.w3.org/TR/timezone/">W3C: Working with Time Zones</a>
</dd></dl> 
<dl class="author" compact><dt><b>Author:</b></dt><dd> David Jarvie &lt;djarvie@kde.org&gt;. </dd></dl>
</p>
<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#Comparison">Comparison</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;Before, AtStart, Inside, AtEnd, After, Equal, Outside, StartsAt, EndsAt&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#SpecType">SpecType</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;Invalid, UTC, OffsetFromUTC, TimeZone, LocalZone, ClockTime&nbsp;}</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="#TimeFormat">TimeFormat</a>&nbsp;</td><td class="memItemRight" valign="bottom">{&nbsp;ISODate, RFCDate, RFCDateDay, QtTextDate, LocalDate, RFC3339Date&nbsp;}</td></tr>
<tr><td colspan="2"><br><h2>Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KDateTime">__init__</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KDateTime">__init__</a> (self, QDate date, <a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec=KDateTime.Spec(KDateTime.LocalZone))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KDateTime">__init__</a> (self, QDate date, QTime time, <a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec=KDateTime.Spec(KDateTime.LocalZone))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KDateTime">__init__</a> (self, QDateTime dt, <a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KDateTime">__init__</a> (self, QDateTime dt)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#KDateTime">__init__</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#addDays">addDays</a> (self, int days)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#addMSecs">addMSecs</a> (self, long msecs)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#addMonths">addMonths</a> (self, int months)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#addSecs">addSecs</a> (self, long secs)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#addYears">addYears</a> (self, int years)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html#Comparison">KDateTime.Comparison</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#compare">compare</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QDate&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#date">date</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QDateTime&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#dateTime">dateTime</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#daysTo">daysTo</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#detach">detach</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isClockTime">isClockTime</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isDateOnly">isDateOnly</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isLocalZone">isLocalZone</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isNull">isNull</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isOffsetFromUtc">isOffsetFromUtc</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isSecondOccurrence">isSecondOccurrence</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isUtc">isUtc</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#isValid">isValid</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#operator !=">operator !=</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#operator <">operator <</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#operator <=">operator <=</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#operator ==">operator ==</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#operator >">operator ></a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#operator >=">operator >=</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#outOfRange">outOfRange</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#secsTo">secsTo</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#secsTo_long">secsTo_long</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> other)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setDate">setDate</a> (self, QDate date)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setDateOnly">setDateOnly</a> (self, bool dateOnly)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setDateTime">setDateTime</a> (self, QDateTime dt)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setSecondOccurrence">setSecondOccurrence</a> (self, bool second)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setTime">setTime</a> (self, QTime time)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setTimeSpec">setTimeSpec</a> (self, <a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setTime_t">setTime_t</a> (self, long seconds)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QTime&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#time">time</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#timeSpec">timeSpec</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html#SpecType">KDateTime.SpecType</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#timeType">timeType</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KTimeZone.html">KTimeZone</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#timeZone">timeZone</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toClockTime">toClockTime</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toLocalZone">toLocalZone</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toOffsetFromUtc">toOffsetFromUtc</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toOffsetFromUtc">toOffsetFromUtc</a> (self, int utcOffset)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toString">toString</a> (self, QString format)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toString">toString</a> (self, <a href="../kdecore/KDateTime.html#TimeFormat">KDateTime.TimeFormat</a> format=KDateTime.ISODate)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toTimeSpec">toTimeSpec</a> (self, <a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toTimeSpec">toTimeSpec</a> (self, <a href="../kdecore/KDateTime.html">KDateTime</a> dt)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toTime_t">toTime_t</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toUtc">toUtc</a> (self)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#toZone">toZone</a> (self, <a href="../kdecore/KTimeZone.html">KTimeZone</a> zone)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#utcOffset">utcOffset</a> (self)</td></tr>
<tr><td colspan="2"><br><h2>Static Methods</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#currentDateTime">currentDateTime</a> (<a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QDate&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#currentLocalDate">currentLocalDate</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#currentLocalDateTime">currentLocalDateTime</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QTime&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#currentLocalTime">currentLocalTime</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#currentUtcDateTime">currentUtcDateTime</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>, bool negZero&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#fromString">fromString</a> (QString string, <a href="../kdecore/KDateTime.html#TimeFormat">KDateTime.TimeFormat</a> format=KDateTime.ISODate)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#fromString">fromString</a> (QString string, QString format, <a href="../kdecore/KTimeZones.html">KTimeZones</a> zones=0, bool offsetIfAmbiguous=1)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#realCurrentLocalDateTime">realCurrentLocalDateTime</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setFromStringDefault">setFromStringDefault</a> (<a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> spec)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="#setSimulatedSystemTime">setSimulatedSystemTime</a> (<a href="../kdecore/KDateTime.html">KDateTime</a> newTime)</td></tr>
</table>
<hr><h2>Method Documentation</h2><a class="anchor" name="KDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Constructs an invalid date/time.
</p></div></div><a class="anchor" name="KDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QDate&nbsp;</td>
<td class="paramname"><em>date</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec=KDateTime.Spec(KDateTime.LocalZone)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs a date-only value expressed in a given time specification. The
time is set to 00:00:00.
</p>
<p>
The instance is initialised according to the time specification type of
<b>spec</b> as follows:
- UTC : date is stored as UTC.
- OffsetFromUTC : date is a local time at the specified offset
from UTC.
- TimeZone : date is a local time in the specified time zone.
- LocalZone : date is a local date in the current system time
zone.
- ClockTime : time zones are ignored.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>date</em>&nbsp;</td><td> date in the time zone indicated by <b>spec</b>

<tr><td></td><td valign="top"><em>spec</em>&nbsp;</td><td> time specification
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="KDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QDate&nbsp;</td>
<td class="paramname"><em>date</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QTime&nbsp;</td>
<td class="paramname"><em>time</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec=KDateTime.Spec(KDateTime.LocalZone)</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs a date/time expressed as specified by <b>spec.</b>
</p>
<p>
<b>date</b> and <b>time</b> are interpreted and stored according to the value of
<b>spec</b> as follows:
- UTC : <b>date</b> and <b>time</b> are in UTC.
- OffsetFromUTC : date/time is a local time at the specified offset
from UTC.
- TimeZone : date/time is a local time in the specified time zone.
- LocalZone : <b>date</b> and <b>time</b> are local times in the current
system time zone.
- ClockTime : time zones are ignored.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>date</em>&nbsp;</td><td> date in the time zone indicated by <b>spec</b>

<tr><td></td><td valign="top"><em>time</em>&nbsp;</td><td> time in the time zone indicated by <b>spec</b>

<tr><td></td><td valign="top"><em>spec</em>&nbsp;</td><td> time specification
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="KDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QDateTime&nbsp;</td>
<td class="paramname"><em>dt</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs a date/time expressed in a given time specification.
</p>
<p>
<b>dt</b> is interpreted and stored according to the time specification type
of <b>spec</b> as follows:
- UTC : <b>dt</b> is stored as a UTC value. If
dt.timeSpec() is Qt.LocalTime, <b>dt</b> is first
converted from the current system time zone to UTC
before storage.
- OffsetFromUTC : date/time is stored as a local time at the specified
offset from UTC. If dt.timeSpec() is Qt.UTC,
the time is adjusted by the UTC offset before
storage. If dt.timeSpec() is Qt.LocalTime,
it is assumed to be a local time at the specified
offset from UTC, and is stored without adjustment.
- TimeZone : if <b>dt</b> is specified as a UTC time (i.e. dt.timeSpec()
is Qt.UTC), it is first converted to local time in
specified time zone before being stored.
- LocalZone : <b>dt</b> is stored as a local time in the current system
time zone. If dt.timeSpec() is Qt.UTC, <b>dt</b> is
first converted to local time before storage.
- ClockTime : If dt.timeSpec() is Qt.UTC, <b>dt</b> is first
converted to local time in the current system time zone
before storage. After storage, the time is treated as a
simple clock time, ignoring time zones.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>dt</em>&nbsp;</td><td> date and time

<tr><td></td><td valign="top"><em>spec</em>&nbsp;</td><td> time specification
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="KDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QDateTime&nbsp;</td>
<td class="paramname"><em>dt</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Constructs a date/time from a QDateTime.
The KDateTime is expressed in either UTC or the local system time zone,
according to <b>dt.timeSpec().</b>
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>dt</em>&nbsp;</td><td> date and time
</td></tr>
</table></dl>
<p>
</p></div></div><a class="anchor" name="KDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">__init__</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="addDays"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> addDays</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"><em>days</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns a date/time <b>days</b> days later than the stored date/time.
The result is expressed using the same time specification as the
original instance.
</p>
<p>
Note that if the instance is a local clock time (type ClockTime), any
daylight savings changes or time zone changes during the period may
render the result inaccurate.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> resultant date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> addSecs(), addMonths(), addYears(), daysTo()
</dd></dl>
</p></div></div><a class="anchor" name="addMSecs"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> addMSecs</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"><em>msecs</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns a date/time <b>msecs</b> milliseconds later than the stored date/time.
</p>
<p>
Except when the instance is a local clock time (type ClockTime), the
calculation is done in UTC to ensure that the result takes proper account
of clock changes (e.g. daylight savings) in the time zone. The result is
expressed using the same time specification as the original instance.
</p>
<p>
Note that if the instance is a local clock time (type ClockTime), any
daylight savings changes or time zone changes during the period will
render the result inaccurate.
</p>
<p>
If the instance is date-only, <b>msecs</b> is rounded down to a whole number
of days and that value is added to the date to find the result.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> resultant date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> addSecs(), addDays(), addMonths(), addYears(), secsTo()
</dd></dl>
</p></div></div><a class="anchor" name="addMonths"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> addMonths</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"><em>months</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns a date/time <b>months</b> months later than the stored date/time.
The result is expressed using the same time specification as the
original instance.
</p>
<p>
Note that if the instance is a local clock time (type ClockTime), any
daylight savings changes or time zone changes during the period may
render the result inaccurate.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> resultant date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> addSecs(), addDays(), addYears(), daysTo()
</dd></dl>
</p></div></div><a class="anchor" name="addSecs"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> addSecs</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"><em>secs</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns a date/time <b>secs</b> seconds later than the stored date/time.
</p>
<p>
Except when the instance is a local clock time (type ClockTime), the
calculation is done in UTC to ensure that the result takes proper account
of clock changes (e.g. daylight savings) in the time zone. The result is
expressed using the same time specification as the original instance.
</p>
<p>
Note that if the instance is a local clock time (type ClockTime), any
daylight savings changes or time zone changes during the period will
render the result inaccurate.
</p>
<p>
If the instance is date-only, <b>secs</b> is rounded down to a whole number
of days and that value is added to the date to find the result.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> resultant date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> addMSecs(), addDays(), addMonths(), addYears(), secsTo()
</dd></dl>
</p></div></div><a class="anchor" name="addYears"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> addYears</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"><em>years</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns a date/time <b>years</b> years later than the stored date/time.
The result is expressed using the same time specification as the
original instance.
</p>
<p>
Note that if the instance is a local clock time (type ClockTime), any
daylight savings changes or time zone changes during the period may
render the result inaccurate.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> resultant date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> addSecs(), addDays(), addMonths(), daysTo()
</dd></dl>
</p></div></div><a class="anchor" name="compare"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html#Comparison">KDateTime.Comparison</a> compare</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Compare this instance with another to determine whether they are
simultaneous, earlier or later, and in the case of date-only values,
whether they overlap (i.e. partly coincide but are not wholly
simultaneous).
The comparison takes time zones into account: if the two instances have
different time zones, they are first converted to UTC before comparing.
</p>
<p>
If both instances are date/time values, this instance is considered to
be either simultaneous, earlier or later, and does not overlap.
</p>
<p>
If one instance is date-only and the other is a date/time, this instance
is either strictly earlier, strictly later, or overlaps.
</p>
<p>
If both instance are date-only, they are considered simultaneous if both
their start of day and end of day times are simultaneous with each
other. (Both start and end of day times need to be considered in case a
daylight savings change occurs during that day.) Otherwise, this instance
can be strictly earlier, earlier but overlapping, later but overlapping,
or strictly later.
</p>
<p>
Note that if either instance is a local clock time (type ClockTime),
the result cannot be guaranteed to be correct, since by definition they
contain no information about time zones or daylight savings changes.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the two instances represent the same time, false otherwise
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> operator==(), operator!=(), operator&lt;(), operator&lt;=(), operator&gt;=(), operator&gt;()
</dd></dl>
</p></div></div><a class="anchor" name="date"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QDate date</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the date part of the date/time. The value returned should be
interpreted in terms of the instance's time zone or UTC offset.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> date value
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> time(), dateTime()
</dd></dl>
</p></div></div><a class="anchor" name="dateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QDateTime dateTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the date/time component of the instance, ignoring the time
zone. The value returned should be interpreted in terms of the
instance's time zone or UTC offset. The returned value's timeSpec()
value will be Qt.UTC if the instance is a UTC time, else
Qt.LocalTime. If the instance is date-only, the time value is set to
00:00:00.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> date(), time()
</dd></dl>
</p></div></div><a class="anchor" name="daysTo"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">int daysTo</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Calculates the number of days from this date/time to the <b>other</b> date/time.
In calculating the result, <b>other</b> is first converted to this instance's
time zone. The number of days difference is then calculated ignoring
the time parts of the two date/times. For example, if this date/time
was 13:00 on 1 January 2000, and <b>other</b> was 02:00 on 2 January 2000,
the result would be 1.
</p>
<p>
Note that if either instance is a local clock time (type ClockTime),
the result cannot be guaranteed to be accurate, since by definition they
contain no information about time zones or daylight savings changes.
</p>
<p>
If one instance is date-only and the other is date-time, the date-time
value is first converted to the same time specification as the date-only
value, and the result is the difference in days between the resultant
date and the date-only date.
</p>
<p>
If both instances are date-only, the calculation ignores time zones.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>other</em>&nbsp;</td><td> other date/time
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> number of days difference
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> secsTo(), addDays()
</dd></dl>
</p></div></div><a class="anchor" name="detach"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> detach</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Create a separate copy of this instance's data if it is implicitly shared
with another instance.
</p>
<p>
You would normally only call this if you want different copies of the
same date/time value to cache conversions to different time zones. Because
only the last conversion to another time zone is cached, and the cached
value is implicitly shared, judicious use of detach() could improve
efficiency when handling several time zones. But take care: if used
inappropriately, it will reduce efficiency!
</p></div></div><a class="anchor" name="isClockTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isClockTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the date/time is a local clock time.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if local clock time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isUtc(), timeZone()
</dd></dl>
</p></div></div><a class="anchor" name="isDateOnly"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isDateOnly</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the instance represents a date/time or a date-only value.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if date-only, false if date and time
</dd></dl>
</p></div></div><a class="anchor" name="isLocalZone"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isLocalZone</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the time zone for the date/time is the current local
system time zone.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if local system time zone
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isUtc(), isOffsetFromUtc(), timeZone()
</dd></dl>
</p></div></div><a class="anchor" name="isNull"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isNull</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the date/time is null.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if both date and time are null, else false
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isValid(), QDateTime.isNull()
</dd></dl>
</p></div></div><a class="anchor" name="isOffsetFromUtc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isOffsetFromUtc</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the date/time is a local time at a fixed offset from
UTC.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if local time at fixed offset from UTC
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isLocal(), isUtc(), utcOffset()
</dd></dl>
</p></div></div><a class="anchor" name="isSecondOccurrence"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isSecondOccurrence</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the date/time is the second occurrence of this time. This
is only applicable to a date/time expressed in terms of a time zone (type
TimeZone or LocalZone), around the time of change from daylight
savings to standard time.
</p>
<p>
When a shift from daylight savings time to standard time occurs, the local
times (typically the previous hour) immediately preceding the shift occur
twice. For example, if a time shift of 1 hour happens at 03:00, the clock
jumps backwards to 02:00, so the local times between 02:00:00 and 02:59:59
occur once before the shift, and again after the shift.
</p>
<p>
For instances which are not of type TimeZone, or when the date/time is
not near to a time shift, false is returned.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the time is the second occurrence, false otherwise
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> setSecondOccurrence()
</dd></dl>
</p></div></div><a class="anchor" name="isUtc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isUtc</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the date/time is a UTC time.
It is considered to be a UTC time if it either has a UTC time
specification (SpecType == UTC), or has a zero offset from UTC
(SpecType == OffsetFromUTC with zero UTC offset).
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if UTC
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isLocal(), isOffsetFromUtc(), timeZone()
</dd></dl>
</p></div></div><a class="anchor" name="isValid"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool isValid</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns whether the date/time is valid.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if both date and time are valid, else false
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isNull(), QDateTime.isValid()
</dd></dl>
</p></div></div><a class="anchor" name="operator !="></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator !=</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="operator <"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator <</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Check whether this date/time is earlier than another.
The comparison takes time zones into account: if the two instances have
different time zones, they are first converted to UTC before comparing.
</p>
<p>
Note that if either instance is a local clock time (type ClockTime),
the result cannot be guaranteed to be correct, since by definition they
contain no information about time zones or daylight savings changes.
</p>
<p>
If one or both instances are date-only, the comparison returns true if
this date/time or day, falls wholly before the other date/time or
day. To achieve this, the time used in the comparison is the end of day
(if this instance is date-only) or the start of day (if the other
instance is date-only).
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if this instance represents an earlier time than <b>other,</b>
</dd></dl> false otherwise
<dl class="see" compact><dt><b>See also:</b></dt><dd> compare()
</dd></dl>
</p></div></div><a class="anchor" name="operator <="></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator <=</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="operator =="></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator ==</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Check whether this date/time is simultaneous with another.
The comparison takes time zones into account: if the two instances have
different time zones, they are first converted to UTC before comparing.
</p>
<p>
Note that if either instance is a local clock time (type ClockTime),
the result cannot be guaranteed to be correct, since by definition they
contain no information about time zones or daylight savings changes.
</p>
<p>
If one instance is date-only and the other is date/time, they are
considered unequal.
</p>
<p>
If both instances are date-only, they are considered simultaneous if both
their start of day and end of day times are simultaneous with each
other. (Both start and end of day times need to be considered in case a
daylight saving change occurs during that day.)
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if the two instances represent the same time, false otherwise
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> compare()
</dd></dl>
</p></div></div><a class="anchor" name="operator >"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator ></td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="operator >="></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool operator >=</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"></div></div><a class="anchor" name="outOfRange"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">bool outOfRange</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Checks whether the date/time returned by the last call to fromString()
was invalid because an otherwise valid date was outside the range which
can be represented by QDate. This status occurs when fromString() read
a valid string containing a year earlier than -4712 (4713 BC). On exit
from fromString(), if outOfRange() returns true, isValid() will
return false.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> true if date was earlier than -4712, else false
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isValid(), fromString()
</dd></dl>
</p></div></div><a class="anchor" name="secsTo"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">int secsTo</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the number of seconds from this date/time to the <b>other</b> date/time.
</p>
<p>
Before performing the comparison, the two date/times are converted to UTC
to ensure that the result is correct if one of the two date/times has
daylight saving time (DST) and the other doesn't. The exception is when
both instances are local clock time, in which case no conversion to UTC
is done.
</p>
<p>
Note that if either instance is a local clock time (type ClockTime),
the result cannot be guaranteed to be accurate, since by definition they
contain no information about time zones or daylight savings changes.
</p>
<p>
If one instance is date-only and the other is date-time, the date-time
value is first converted to the same time specification as the date-only
value, and the result is the difference in days between the resultant
date and the date-only date.
</p>
<p>
If both instances are date-only, the result is the difference in days
between the two dates, ignoring time zones.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>other</em>&nbsp;</td><td> other date/time
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> number of seconds difference
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> secsTo_long(), addSecs(), daysTo()
</dd></dl>
</p></div></div><a class="anchor" name="secsTo_long"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">long secsTo_long</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>other</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the number of seconds from this date/time to the <b>other</b> date/time.
</p>
<p>
Before performing the comparison, the two date/times are converted to UTC
to ensure that the result is correct if one of the two date/times has
daylight saving time (DST) and the other doesn't. The exception is when
both instances are local clock time, in which case no conversion to UTC
is done.
</p>
<p>
Note that if either instance is a local clock time (type ClockTime),
the result cannot be guaranteed to be accurate, since by definition they
contain no information about time zones or daylight savings changes.
</p>
<p>
If one instance is date-only and the other is date-time, the date-time
value is first converted to the same time specification as the date-only
value, and the result is the difference in days between the resultant
date and the date-only date.
</p>
<p>
If both instances are date-only, the result is the difference in days
between the two dates, ignoring time zones.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>other</em>&nbsp;</td><td> other date/time
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> number of seconds difference
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> secsTo(), addSecs(), daysTo()
</dd></dl>
</p></div></div><a class="anchor" name="setDate"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setDate</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QDate&nbsp;</td>
<td class="paramname"><em>date</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the date part of the date/time.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>date</em>&nbsp;</td><td> new date value
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> date(), setTime(), setTimeSpec(), setTime_t(), setDateOnly()
</dd></dl>
</p></div></div><a class="anchor" name="setDateOnly"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setDateOnly</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"><em>dateOnly</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the instance either to being a date and time value, or a date-only
value. If its status is changed to date-only, its time is set to
00:00:00.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>dateOnly</em>&nbsp;</td><td> true to set to date-only, false to set to date
and time.
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> isDateOnly(), setTime()
</dd></dl>
</p></div></div><a class="anchor" name="setDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setDateTime</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QDateTime&nbsp;</td>
<td class="paramname"><em>dt</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the date/time part of the instance, leaving the time specification
unaffected.
</p>
<p>
If <b>dt</b> is a local time (\code dt.timeSpec() == Qt.LocalTime \endcode)
and the instance is UTC, <b>dt</b> is first converted from the current
system time zone to UTC before being stored.
</p>
<p>
If the instance was date-only, it is changed to being a date and time
value.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>dt</em>&nbsp;</td><td> date and time
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> dateTime(), setDate(), setTime(), setTimeSpec()
</dd></dl>
</p></div></div><a class="anchor" name="setSecondOccurrence"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setSecondOccurrence</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"><em>second</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets whether the date/time is the second occurrence of this time. This
is only applicable to a date/time expressed in terms of a time zone (type
TimeZone or LocalZone), around the time of change from daylight
savings to standard time.
</p>
<p>
When a shift from daylight savings time to standard time occurs, the local
times (typically the previous hour) immediately preceding the shift occur
twice. For example, if a time shift of 1 hour happens at 03:00, the clock
jumps backwards to 02:00, so the local times between 02:00:00 and 02:59:59
occur once before the shift, and again after the shift.
</p>
<p>
For instances which are not of type TimeZone, or when the date/time is
not near to a time shift, calling this method has no effect.
</p>
<p>
Note that most other setting methods clear the second occurrence indicator,
so if you want to retain its setting, you must call setSecondOccurrence()
again after changing the instance's value.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>second</em>&nbsp;</td><td> true to set as the second occurrence, false to set as
the first occurrence
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> isSecondOccurrence()
</dd></dl>
</p></div></div><a class="anchor" name="setTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setTime</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QTime&nbsp;</td>
<td class="paramname"><em>time</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the time part of the date/time. If the instance was date-only, it
is changed to being a date and time value.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>time</em>&nbsp;</td><td> new time value
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> time(), setDate(), setTimeSpec(), setTime_t()
</dd></dl>
</p></div></div><a class="anchor" name="setTimeSpec"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setTimeSpec</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Changes the time specification of the instance.
</p>
<p>
Any previous time zone is forgotten. The stored date/time component of
the instance is left unchanged (except that its UTC/local time setting
is set to correspond with <b>spec).</b> Usually this method will change the
absolute time which this instance represents.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>spec</em>&nbsp;</td><td> new time specification
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> timeSpec(), timeZone()
</dd></dl>
</p></div></div><a class="anchor" name="setTime_t"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setTime_t</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">long&nbsp;</td>
<td class="paramname"><em>seconds</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the time to a UTC time, specified as seconds since 00:00:00 UTC
1st January 1970 (as returned by time(2)).
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>seconds</em>&nbsp;</td><td> number of seconds since 00:00:00 UTC 1st January 1970
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> toTime_t()
</dd></dl>
</p></div></div><a class="anchor" name="time"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QTime time</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time part of the date/time. The value returned should be
interpreted in terms of the instance's time zone or UTC offset. If
the instance is date-only, the time returned is 00:00:00.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> time value
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> date(), dateTime(), isDateOnly()
</dd></dl>
</p></div></div><a class="anchor" name="timeSpec"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a> timeSpec</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time specification of the date/time, i.e. whether it is
UTC, what time zone it is, etc.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> time specification
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isLocalZone(), isClockTime(), isUtc(), timeZone()
</dd></dl>
</p></div></div><a class="anchor" name="timeType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html#SpecType">KDateTime.SpecType</a> timeType</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time specification type of the date/time, i.e. whether it is
UTC, has a time zone, etc. If the type is the local time zone,
TimeZone is returned; use isLocalZone() to check for the local time
zone.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> specification type
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> timeSpec(), isLocalZone(), isClockTime(), isUtc(), timeZone()
</dd></dl>
</p></div></div><a class="anchor" name="timeZone"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KTimeZone.html">KTimeZone</a> timeZone</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time zone for the date/time. If the date/time is specified
as a UTC time, a UTC time zone is always returned.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> time zone, or invalid if a local time at a fixed UTC offset or a
local clock time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isUtc(), isLocal()
</dd></dl>
</p></div></div><a class="anchor" name="toClockTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toClockTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time converted to the local clock time. The time is first
converted to the local system time zone before setting its type to
ClockTime, i.e. no associated time zone.
If the instance is a date-only value, a date-only clock time value is
returned, with the date unchanged.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toLocalZone(), toTimeSpec()
</dd></dl>
</p></div></div><a class="anchor" name="toLocalZone"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toLocalZone</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time converted to the current local system time zone.
If the instance is a date-only value, a date-only local time zone value
is returned, with the date unchanged.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toUtc(), toOffsetFromUtc(), toZone(), toTimeSpec(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="toOffsetFromUtc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toOffsetFromUtc</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time expressed as a specified offset from UTC.
</p>
<p>
If the instance is a local clock time, it is first set to the local time
zone, and then converted to the UTC offset.
If the instance is a date-only value, a date-only clock time value is
returned, with the date unchanged.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>utcOffset</em>&nbsp;</td><td> number of seconds to add to UTC to get the local time.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toUtc(), toOffsetFromUtc(), toLocalZone(), toZone(), toTimeSpec(), toTime_t(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="toOffsetFromUtc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toOffsetFromUtc</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"><em>utcOffset</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the time expressed as a specified offset from UTC.
</p>
<p>
If the instance is a local clock time, it is first set to the local time
zone, and then converted to the UTC offset.
If the instance is a date-only value, a date-only clock time value is
returned, with the date unchanged.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>utcOffset</em>&nbsp;</td><td> number of seconds to add to UTC to get the local time.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toUtc(), toOffsetFromUtc(), toLocalZone(), toZone(), toTimeSpec(), toTime_t(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="toString"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QString toString</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString&nbsp;</td>
<td class="paramname"><em>format</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the date/time as a string, formatted according to the <b>format</b>
parameter, with the UTC offset appended.
</p>
<p>
Note that if the instance has a time specification of ClockTime, the UTC
offset in the result will be blank, except for RFC 2822 and RFC 3339
formats in which it will be the offset for the local system time zone.
</p>
<p>
If the instance is date-only, the time will when <b>format</b> permits be
omitted from the output string. This applies to <b>format</b> = QtTextDate
or LocalDate. It also applies to <b>format</b> = ISODate when the instance
has a time specification of ClockTime. For all other cases, a time of
00:00:00 will be output.
</p>
<p>
For RFC 2822 format, set <b>format</b> to RFCDateDay to include the day
of the week, or to RFCDate to omit it.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>format</em>&nbsp;</td><td> format for output string
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> formatted string
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> fromString(), QDateTime.toString()
</dd></dl>
</p></div></div><a class="anchor" name="toString"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QString toString</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html#TimeFormat">KDateTime.TimeFormat</a>&nbsp;</td>
<td class="paramname"><em>format=KDateTime.ISODate</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the date/time as a string, formatted according to the <b>format</b>
parameter, with the UTC offset appended.
</p>
<p>
Note that if the instance has a time specification of ClockTime, the UTC
offset in the result will be blank, except for RFC 2822 and RFC 3339
formats in which it will be the offset for the local system time zone.
</p>
<p>
If the instance is date-only, the time will when <b>format</b> permits be
omitted from the output string. This applies to <b>format</b> = QtTextDate
or LocalDate. It also applies to <b>format</b> = ISODate when the instance
has a time specification of ClockTime. For all other cases, a time of
00:00:00 will be output.
</p>
<p>
For RFC 2822 format, set <b>format</b> to RFCDateDay to include the day
of the week, or to RFCDate to omit it.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>format</em>&nbsp;</td><td> format for output string
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> formatted string
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> fromString(), QDateTime.toString()
</dd></dl>
</p></div></div><a class="anchor" name="toTimeSpec"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toTimeSpec</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the time converted to the time specification of another instance.
If this instance is a local clock time, it is first set to the local time
zone, and then converted to the <b>spec</b> time specification.
If this instance is a date-only value, a date-only value is returned,
with the date unchanged.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>dt</em>&nbsp;</td><td> instance providing the new time specification
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toLocalZone(), toUtc(), toOffsetFromUtc(), toZone(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="toTimeSpec"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toTimeSpec</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>dt</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the time converted to the time specification of another instance.
If this instance is a local clock time, it is first set to the local time
zone, and then converted to the <b>spec</b> time specification.
If this instance is a date-only value, a date-only value is returned,
with the date unchanged.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>dt</em>&nbsp;</td><td> instance providing the new time specification
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toLocalZone(), toUtc(), toOffsetFromUtc(), toZone(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="toTime_t"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">long toTime_t</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Converts the time to a UTC time, measured in seconds since 00:00:00 UTC
1st January 1970 (as returned by time(2)).
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time, or uint(-1) if the date is out of range or invalid
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> setTime_t()
</dd></dl>
</p></div></div><a class="anchor" name="toUtc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toUtc</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the time converted to UTC. The converted time has a UTC offset
of zero.
If the instance is a local clock time, it is first set to the local time
zone, and then converted to UTC.
If the instance is a date-only value, a date-only UTC value is returned,
with the date unchanged.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toOffsetFromUtc(), toLocalZone(), toZone(), toTimeSpec(), toTime_t(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="toZone"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> toZone</td>
<td>(</td>
<td class="paramtype">&nbsp;<em>self</em>, </td>
<td class="paramname"></td>
</tr><tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KTimeZone.html">KTimeZone</a>&nbsp;</td>
<td class="paramname"><em>zone</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the time converted to a specified time zone.
If the instance is a local clock time, it is first set to the local time
zone, and then converted to <b>zone.</b>
If the instance is a date-only value, a date-only value in <b>zone</b> is
returned, with the date unchanged.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>zone</em>&nbsp;</td><td> time zone to convert to
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> converted time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> toUtc(), toOffsetFromUtc(), toLocalZone(), toTimeSpec(), KTimeZone.convert()
</dd></dl>
</p></div></div><a class="anchor" name="utcOffset"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">int utcOffset</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname"><em>self</em>&nbsp;)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the UTC offset associated with the date/time. The UTC offset is
the number of seconds to add to UTC to get the local time.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> UTC offset in seconds, or 0 if local clock time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> isClockTime()
</dd></dl>
</p></div></div><hr><h2>Static Method Documentation</h2><a class="anchor" name="currentDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> currentDateTime</td>
<td>(</td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the current date and time, as reported by the system clock,
expressed in a given time specification.
</p>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd> To fetch the current date and time expressed in UTC or in the local
system time zone, it is more efficient to use currentUtcDateTime() or
currentLocalDateTime().
</dd></dl> </p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>spec</em>&nbsp;</td><td> time specification
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> current date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> currentUtcDateTime(), currentLocalDateTime()
</dd></dl>
</p></div></div><a class="anchor" name="currentLocalDate"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QDate currentLocalDate</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the current date in the local time zone, as reported by the
system clock.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> current date
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> currentLocalDateTime(), currentLocalTime()
</dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.3
</dd></dl>
</p></div></div><a class="anchor" name="currentLocalDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> currentLocalDateTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the current date and time, as reported by the system clock,
expressed in the local system time zone.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> current date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> currentUtcDateTime(), currentDateTime()
</dd></dl>
</p></div></div><a class="anchor" name="currentLocalTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname">QTime currentLocalTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the current time of day in the local time zone, as reported
by the system clock.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> current date
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> currentLocalDateTime(), currentLocalDate()
</dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.3
</dd></dl>
</p></div></div><a class="anchor" name="currentUtcDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> currentUtcDateTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Returns the current date and time, as reported by the system clock,
expressed in UTC.
</p>
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd> current date/time
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> currentLocalDateTime(), currentDateTime(), currentLocalDate(), currentLocalTime()
</dd></dl>
</p></div></div><a class="anchor" name="fromString"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a>, bool negZero fromString</td>
<td>(</td>
<td class="paramtype">QString&nbsp;</td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KDateTime.html#TimeFormat">KDateTime.TimeFormat</a>&nbsp;</td>
<td class="paramname"><em>format=KDateTime.ISODate</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the KDateTime represented by <b>string,</b> using the <b>format</b>
given, optionally using a time zone collection <b>zones</b> as the source of
time zone definitions. The <b>format</b> codes are basically the same as
those for toString(), and are similar but not identical to those used by
strftime(3).
</p>
<p>
The <b>format</b> string consists of the same codes as that for
toString(). However, some codes which are distinct in toString() have
the same function as each other here.
</p>
<p>
Numeric values without a stated number of digits permit, but do not
require, leading zeroes. The maximum number of digits consumed by a
numeric code is the minimum needed to cover the possible range of the
number (e.g. for minutes, the range is 0 - 59, so the maximum number of
digits consumed is 2). All non-numeric values are case insensitive.
</p>
<p>
<b>Date</b>
</p>
<p>
- \%y year excluding century (0 - 99). Years 0 - 50 return 2000 - 2050,
while years 51 - 99 return 1951 - 1999.
- \%Y full year number (4 digits with optional sign)
- %:Y full year number (&gt;= 4 digits with optional sign)
- %:m month number (1 - 12)
- \%m month number, 2 digits (01 - 12)
- \%b
- \%B month name in the current locale or, if no match, in English,
abbreviated or in full
- %:b
- %:B month name in English, abbreviated or in full
- \%e day of the month (1 - 31)
- \%d day of the month, 2 digits (01 - 31)
- \%a
- \%A weekday name in the current locale or, if no match, in English,
abbreviated or in full
- %:a
- %:A weekday name in English, abbreviated or in full
</p>
<p>
<b>Time</b>
</p>
<p>
- \%H hour in the 24 hour clock, 2 digits (00 - 23)
- \%k hour in the 24 hour clock (0 - 23)
- \%I hour in the 12 hour clock, 2 digits (01 - 12)
- \%l hour in the 12 hour clock (1 - 12)
- \%M minute, 2 digits (00 - 59)
- %:M minute (0 - 59)
- \%S seconds, 2 digits (00 - 59)
- \%s seconds (0 - 59)
- %:S optional seconds value (0 - 59) preceded with ':'. If no colon is
found in <b>string,</b> no input is consumed and the seconds value is
set to zero.
- %:s fractional seconds value, preceded with a decimal point (either '.'
or the locale's decimal point symbol)
- \%P
- \%p "am" or "pm", in the current locale or, if no match, in
English. This format is only useful when used with \%I or \%l.
- %:P
- %:p "am" or "pm" in English. This format is only useful when used with
\%I or \%l.
</p>
<p>
<b>Time</b> zone
</p>
<p>
- %:u
- \%z UTC offset of the time zone in hours and optionally minutes,
e.g. -02, -0200.
- %:z UTC offset of the time zone in hours and minutes, colon separated,
e.g. +02:00.
- \%Z time zone abbreviation, consisting of alphanumeric characters,
e.g. UTC, EDT, GMT.
- %:Z time zone name, e.g. Europe/London. The name may contain any
characters and is delimited by the following character in the
<b>format</b> string. It will not work if you follow %:Z with another
escape sequence (except %% or \%t).
</p>
<p>
<b>Other</b>
</p>
<p>
- \%t matches one or more whitespace characters
- %% literal '\%' character
</p>
<p>
Any other character must have a matching character in <b>string,</b> except
that a space will match zero or more whitespace characters in the input
string.
</p>
<p>
If any time zone information is present in the string, the function
attempts to find a matching time zone in the <b>zones</b> collection. A time
zone name (format code %:Z) will provide an unambiguous look up in
<b>zones.</b> Any other type of time zone information (an abbreviated time
zone code (\%Z) or UTC offset (\%z, %:z, %:u) is searched for in <b>zones</b>
and if only one time zone is found to match, the result is set to that
zone. Otherwise:
- If more than one match of a UTC offset is found, the action taken is
determined by <b>offsetIfAmbiguous:</b> if <b>offsetIfAmbiguous</b> is true,
a local time with an offset from UTC (type OffsetFromUTC) will be
returned; if false an invalid KDateTime is returned.
- If more than one match of a time zone abbreviation is found, the UTC
offset for each matching time zone is compared and, if the offsets are
the same, a local time with an offset from UTC (type OffsetFromUTC)
will be returned provided that <b>offsetIfAmbiguous</b> is true. Otherwise
an invalid KDateTime is returned.
- If a time zone abbreviation does not match any time zone in <b>zones,</b>
or the abbreviation does not apply at the parsed date/time, an
invalid KDateTime is returned.
- If a time zone name does not match any time zone in <b>zones,</b> an
invalid KDateTime is returned.
- If the time zone UTC offset does not match any time zone in <b>zones,</b>
a local time with an offset from UTC (type OffsetFromUTC) is
returned.
If <b>format</b> contains more than one time zone or UTC offset code, an
error is returned.
</p>
<p>
If no time zone information is present in the string, by default a local
clock time (type ClockTime) is returned. You can use
setFromStringDefault() to change this default.
</p>
<p>
If no time is found in <b>string,</b> a date-only value is returned.
</p>
<p>
If any inconsistencies are found, i.e. the same item of information
appears more than once but with different values, the weekday name does
not tally with the date, an invalid KDateTime is returned.
</p>
<p>
If an invalid KDateTime is returned, you can check why <b>format</b> was
considered invalid by use of outOfRange(). If that method returns true,
it indicates that <b>format</b> was in fact valid, but the date lies outside
the range which can be represented by QDate.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>string</em>&nbsp;</td><td> string to convert

<tr><td></td><td valign="top"><em>format</em>&nbsp;</td><td> format string

<tr><td></td><td valign="top"><em>zones</em>&nbsp;</td><td> time zone collection, or null for none

<tr><td></td><td valign="top"><em>offsetIfAmbiguous</em>&nbsp;</td><td> specifies what to do if more than one zone
matches the UTC offset found in the
string. Ignored if <b>zones</b> is null.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> KDateTime value, or an invalid KDateTime if an error occurs, if
time zone information doesn't match any in <b>zones,</b> or if the
time zone information is ambiguous and <b>offsetIfAmbiguous</b> is
false
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> setFromStringDefault(), toString(), outOfRange()
</dd></dl>
</p></div></div><a class="anchor" name="fromString"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> fromString</td>
<td>(</td>
<td class="paramtype">QString&nbsp;</td>
<td class="paramname"><em>string</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">QString&nbsp;</td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype"><a href="../kdecore/KTimeZones.html">KTimeZones</a>&nbsp;</td>
<td class="paramname"><em>zones=0</em>, </td>
</tr>
<tr>
<td class="memname"></td>
<td></td>
<td class="paramtype">bool&nbsp;</td>
<td class="paramname"><em>offsetIfAmbiguous=1</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Returns the KDateTime represented by <b>string,</b> using the <b>format</b>
given, optionally using a time zone collection <b>zones</b> as the source of
time zone definitions. The <b>format</b> codes are basically the same as
those for toString(), and are similar but not identical to those used by
strftime(3).
</p>
<p>
The <b>format</b> string consists of the same codes as that for
toString(). However, some codes which are distinct in toString() have
the same function as each other here.
</p>
<p>
Numeric values without a stated number of digits permit, but do not
require, leading zeroes. The maximum number of digits consumed by a
numeric code is the minimum needed to cover the possible range of the
number (e.g. for minutes, the range is 0 - 59, so the maximum number of
digits consumed is 2). All non-numeric values are case insensitive.
</p>
<p>
<b>Date</b>
</p>
<p>
- \%y year excluding century (0 - 99). Years 0 - 50 return 2000 - 2050,
while years 51 - 99 return 1951 - 1999.
- \%Y full year number (4 digits with optional sign)
- %:Y full year number (&gt;= 4 digits with optional sign)
- %:m month number (1 - 12)
- \%m month number, 2 digits (01 - 12)
- \%b
- \%B month name in the current locale or, if no match, in English,
abbreviated or in full
- %:b
- %:B month name in English, abbreviated or in full
- \%e day of the month (1 - 31)
- \%d day of the month, 2 digits (01 - 31)
- \%a
- \%A weekday name in the current locale or, if no match, in English,
abbreviated or in full
- %:a
- %:A weekday name in English, abbreviated or in full
</p>
<p>
<b>Time</b>
</p>
<p>
- \%H hour in the 24 hour clock, 2 digits (00 - 23)
- \%k hour in the 24 hour clock (0 - 23)
- \%I hour in the 12 hour clock, 2 digits (01 - 12)
- \%l hour in the 12 hour clock (1 - 12)
- \%M minute, 2 digits (00 - 59)
- %:M minute (0 - 59)
- \%S seconds, 2 digits (00 - 59)
- \%s seconds (0 - 59)
- %:S optional seconds value (0 - 59) preceded with ':'. If no colon is
found in <b>string,</b> no input is consumed and the seconds value is
set to zero.
- %:s fractional seconds value, preceded with a decimal point (either '.'
or the locale's decimal point symbol)
- \%P
- \%p "am" or "pm", in the current locale or, if no match, in
English. This format is only useful when used with \%I or \%l.
- %:P
- %:p "am" or "pm" in English. This format is only useful when used with
\%I or \%l.
</p>
<p>
<b>Time</b> zone
</p>
<p>
- %:u
- \%z UTC offset of the time zone in hours and optionally minutes,
e.g. -02, -0200.
- %:z UTC offset of the time zone in hours and minutes, colon separated,
e.g. +02:00.
- \%Z time zone abbreviation, consisting of alphanumeric characters,
e.g. UTC, EDT, GMT.
- %:Z time zone name, e.g. Europe/London. The name may contain any
characters and is delimited by the following character in the
<b>format</b> string. It will not work if you follow %:Z with another
escape sequence (except %% or \%t).
</p>
<p>
<b>Other</b>
</p>
<p>
- \%t matches one or more whitespace characters
- %% literal '\%' character
</p>
<p>
Any other character must have a matching character in <b>string,</b> except
that a space will match zero or more whitespace characters in the input
string.
</p>
<p>
If any time zone information is present in the string, the function
attempts to find a matching time zone in the <b>zones</b> collection. A time
zone name (format code %:Z) will provide an unambiguous look up in
<b>zones.</b> Any other type of time zone information (an abbreviated time
zone code (\%Z) or UTC offset (\%z, %:z, %:u) is searched for in <b>zones</b>
and if only one time zone is found to match, the result is set to that
zone. Otherwise:
- If more than one match of a UTC offset is found, the action taken is
determined by <b>offsetIfAmbiguous:</b> if <b>offsetIfAmbiguous</b> is true,
a local time with an offset from UTC (type OffsetFromUTC) will be
returned; if false an invalid KDateTime is returned.
- If more than one match of a time zone abbreviation is found, the UTC
offset for each matching time zone is compared and, if the offsets are
the same, a local time with an offset from UTC (type OffsetFromUTC)
will be returned provided that <b>offsetIfAmbiguous</b> is true. Otherwise
an invalid KDateTime is returned.
- If a time zone abbreviation does not match any time zone in <b>zones,</b>
or the abbreviation does not apply at the parsed date/time, an
invalid KDateTime is returned.
- If a time zone name does not match any time zone in <b>zones,</b> an
invalid KDateTime is returned.
- If the time zone UTC offset does not match any time zone in <b>zones,</b>
a local time with an offset from UTC (type OffsetFromUTC) is
returned.
If <b>format</b> contains more than one time zone or UTC offset code, an
error is returned.
</p>
<p>
If no time zone information is present in the string, by default a local
clock time (type ClockTime) is returned. You can use
setFromStringDefault() to change this default.
</p>
<p>
If no time is found in <b>string,</b> a date-only value is returned.
</p>
<p>
If any inconsistencies are found, i.e. the same item of information
appears more than once but with different values, the weekday name does
not tally with the date, an invalid KDateTime is returned.
</p>
<p>
If an invalid KDateTime is returned, you can check why <b>format</b> was
considered invalid by use of outOfRange(). If that method returns true,
it indicates that <b>format</b> was in fact valid, but the date lies outside
the range which can be represented by QDate.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>string</em>&nbsp;</td><td> string to convert

<tr><td></td><td valign="top"><em>format</em>&nbsp;</td><td> format string

<tr><td></td><td valign="top"><em>zones</em>&nbsp;</td><td> time zone collection, or null for none

<tr><td></td><td valign="top"><em>offsetIfAmbiguous</em>&nbsp;</td><td> specifies what to do if more than one zone
matches the UTC offset found in the
string. Ignored if <b>zones</b> is null.
</td></tr> </table></dl>
<p> <dl class="return" compact><dt><b>Returns:</b></dt><dd> KDateTime value, or an invalid KDateTime if an error occurs, if
time zone information doesn't match any in <b>zones,</b> or if the
time zone information is ambiguous and <b>offsetIfAmbiguous</b> is
false
</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd> setFromStringDefault(), toString(), outOfRange()
</dd></dl>
</p></div></div><a class="anchor" name="realCurrentLocalDateTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"><a href="../kdecore/KDateTime.html">KDateTime</a> realCurrentLocalDateTime</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">)</td>
<td width="100%"> </td>
</tr>
</table>
</div>
<div class="memdoc"><p>Return the real (not simulated) system time.
</p>
<p>
<dl class="warning" compact><dt><b>Warning:</b></dt><dd> This method is provided only for testing purposes, and should
not be used in released code. If the library is compiled without
debug enabled, currentLocalDateTime() and realCurrentLocalDateTime()
both return the real system time.
To avoid confusion, it is recommended that calls to
realCurrentLocalDateTime() should be conditionally compiled, e.g.:
</dd></dl> <pre class="fragment">
          #ifndef NDEBUG
             dt = KDateTime.realCurrentLocalDateTime();
          #endif
</pre>
</p>
<p>
<dl class="since" compact><dt><b>Since:</b></dt><dd> 4.3
</dd></dl>
</p></div></div><a class="anchor" name="setFromStringDefault"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setFromStringDefault</td>
<td>(</td>
<td class="paramtype"><a href="../kdecore/KDateTime.Spec.html">KDateTime.Spec</a>&nbsp;</td>
<td class="paramname"><em>spec</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Sets the default time specification for use by fromString() when no time
zone or UTC offset is found in the string being parsed, or when "-0000"
is found in an RFC 2822 string.
</p>
<p>
By default, fromString() returns a local clock time (type ClockTime)
when no definite zone or UTC offset is found. You can use this method
to make it return the local time zone, UTC, or whatever you wish.
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>spec</em>&nbsp;</td><td> the new default time specification
</td></tr> </table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> fromString()
</dd></dl>
</p></div></div><a class="anchor" name="setSimulatedSystemTime"></a>
<div class="memitem">
<div class="memproto">
<table class="memname"><tr>
<td class="memname"> setSimulatedSystemTime</td>
<td>(</td>
<td class="paramtype"><a href="../kdecore/KDateTime.html">KDateTime</a>&nbsp;</td>
<td class="paramname"><em>newTime</em></td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td>
<td></td>
<td width="100%"> </td>
</tr></table>
</div>
<div class="memdoc"><p>Set an adjustment to be applied when fetching the current system time.
This is applied by all KDateTime methods which return the system date
and/or time.
</p>
<p>
The supplied date/time is used as the current simulated time and the
time adjustment is set to the difference between the real current time
and <b>newTime.</b> If <b>newTime</b> has a time zone, that time zone is set
to be the simulated local system time zone by calling
KSystemTimeZones.setLocalZone()).
</p>
<p>
To cancel time simulation, supply an invalid <b>newTime</b> parameter.
</p>
<p>
<dl class="warning" compact><dt><b>Warning:</b></dt><dd> This function is provided only for testing purposes, and should
not be used in released code. If the library is compiled without
debug enabled, setSimulatedSystemTime() has no effect.
To avoid confusion, it is recommended that calls to it should be
conditionally compiled, e.g.:
</dd></dl> <pre class="fragment">
          #ifndef NDEBUG
             KDateTime.simulateSystemTime(kdt);
          #endif
</pre>
</p>
<p>
</p><dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign="top"><em>newTime</em>&nbsp;</td><td> the current simulated time, or invalid to cancel simulation
</td></tr>
</table></dl>
<p> <dl class="see" compact><dt><b>See also:</b></dt><dd> currentDateTime(), currentLocalDateTime(), currentUtcDateTime(),
currentLocalDate(), currentLocalTime()
</dd></dl> <dl class="since" compact><dt><b>Since:</b></dt><dd> 4.3
</dd></dl>
</p></div></div><hr><h2>Enumeration Documentation</h2><a class="anchor" name="Comparison"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">Comparison</td>
</tr>
</table>
</div>
<div class="memdoc"><p>How this KDateTime compares with another.
If any date-only value is involved, comparison of KDateTime values
requires them to be considered as representing time periods. A date-only
instance represents a time period from 00:00:00 to 23:59:59.999 on a given
date, while a date/time instance can be considered to represent a time
period whose start and end times are the same. They may therefore be
earlier or later, or may overlap or be contained one within the other.
</p>
<p>
Values may be OR'ed with each other in any combination of 'consecutive'
intervals to represent different types of relationship.
</p>
<p>
In the descriptions of the values below,
- s1 = start time of this instance
- e1 = end time of this instance
- s2 = start time of other instance
- e2 = end time of other instance.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>Before</em>&nbsp;=&nbsp;0x01</td><td><tr><td valign="top"><em>AtStart</em>&nbsp;=&nbsp;0x02</td><td><tr><td valign="top"><em>Inside</em>&nbsp;=&nbsp;0x04</td><td><tr><td valign="top"><em>AtEnd</em>&nbsp;=&nbsp;0x08</td><td><tr><td valign="top"><em>After</em>&nbsp;=&nbsp;0x10</td><td><tr><td valign="top"><em>Equal</em>&nbsp;=&nbsp;AtStart|Inside|AtEnd</td><td><tr><td valign="top"><em>Outside</em>&nbsp;=&nbsp;Before|AtStart|Inside|AtEnd|After</td><td><tr><td valign="top"><em>StartsAt</em>&nbsp;=&nbsp;AtStart|Inside|AtEnd|After</td><td><tr><td valign="top"><em>EndsAt</em>&nbsp;=&nbsp;Before|AtStart|Inside|AtEnd</td><td></table>
</dl>
</div></div><p><a class="anchor" name="SpecType"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">SpecType</td>
</tr>
</table>
</div>
<div class="memdoc"><p>The time specification type of a KDateTime instance.
This specifies how the date/time component of the KDateTime instance
should be interpreted, i.e. what type of time zone (if any) the date/time
is expressed in. For the full time specification (including time zone
details), see KDateTime.Spec.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>Invalid</em>&nbsp;</td><td><tr><td valign="top"><em>UTC</em>&nbsp;</td><td><tr><td valign="top"><em>OffsetFromUTC</em>&nbsp;</td><td><tr><td valign="top"><em>TimeZone</em>&nbsp;</td><td><tr><td valign="top"><em>LocalZone</em>&nbsp;</td><td><tr><td valign="top"><em>ClockTime</em>&nbsp;</td><td></table>
</dl>
</div></div><p><a class="anchor" name="TimeFormat"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr><td class="memname">TimeFormat</td>
</tr>
</table>
</div>
<div class="memdoc"><p>Format for strings representing date/time values.
</p><dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0"><tr><td valign="top"><em>ISODate</em>&nbsp;</td><td><tr><td valign="top"><em>RFCDate</em>&nbsp;</td><td><tr><td valign="top"><em>RFCDateDay</em>&nbsp;</td><td><tr><td valign="top"><em>QtTextDate</em>&nbsp;</td><td><tr><td valign="top"><em>LocalDate</em>&nbsp;</td><td><tr><td valign="top"><em>RFC3339Date</em>&nbsp;</td><td></table>
</dl>
</div></div><p>
</div>
</div>
</div>

<div id="left">

<div class="menu_box">
<div class="nav_list">
<ul>
<li><a href="../allclasses.html">Full Index</a></li>
</ul>
</div>

<a name="cp-menu" /><div class="menutitle"><div>
  <h2 id="cp-menu-project">Modules</h2>
</div></div>
<div class="nav_list">
<ul><li><a href="../akonadi/index.html">akonadi</a></li>
<li><a href="../dnssd/index.html">dnssd</a></li>
<li><a href="../kdecore/index.html">kdecore</a></li>
<li><a href="../kdeui/index.html">kdeui</a></li>
<li><a href="../khtml/index.html">khtml</a></li>
<li><a href="../kio/index.html">kio</a></li>
<li><a href="../knewstuff/index.html">knewstuff</a></li>
<li><a href="../kparts/index.html">kparts</a></li>
<li><a href="../kutils/index.html">kutils</a></li>
<li><a href="../nepomuk/index.html">nepomuk</a></li>
<li><a href="../phonon/index.html">phonon</a></li>
<li><a href="../plasma/index.html">plasma</a></li>
<li><a href="../polkitqt/index.html">polkitqt</a></li>
<li><a href="../solid/index.html">solid</a></li>
<li><a href="../soprano/index.html">soprano</a></li>
</ul></div></div>

</div>

</div>
  <div class="clearer"/>
</div>

<div id="end_body"></div>
</div>
<div id="footer"><div id="footer_text">
This documentation is maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;simon&#64;simonzone&#46;com">Simon Edwards</a>.<br />
        KDE<sup>&#174;</sup> and <a href="../images/kde_gear_black.png">the K Desktop Environment<sup>&#174;</sup> logo</a> are registered trademarks of <a href="http://ev.kde.org/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
        <a href="http://www.kde.org/contact/impressum.php">Legal</a>
    </div></div>
</body>
</html>