File: qdate.html

package info (click to toggle)
python-qt4 4.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,300 kB
  • ctags: 6,185
  • sloc: python: 125,988; cpp: 13,291; xml: 292; makefile: 246; php: 27; sh: 2
file content (631 lines) | stat: -rw-r--r-- 43,910 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDate Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDate Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QDate class provides date functions. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdate.html#MonthNameType-enum">MonthNameType</a></b> { DateFormat, StandaloneFormat }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdate.html#QDate">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdate.html#QDate-2">__init__</a></b> (<i>self</i>, int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</li><li><div class="fn" /><b><a href="qdate.html#QDate-3">__init__</a></b> (<i>self</i>, QDate)</li><li><div class="fn" />QDate <b><a href="qdate.html#addDays">addDays</a></b> (<i>self</i>, int&#160;<i>days</i>)</li><li><div class="fn" />QDate <b><a href="qdate.html#addMonths">addMonths</a></b> (<i>self</i>, int&#160;<i>months</i>)</li><li><div class="fn" />QDate <b><a href="qdate.html#addYears">addYears</a></b> (<i>self</i>, int&#160;<i>years</i>)</li><li><div class="fn" />int <b><a href="qdate.html#day">day</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#dayOfWeek">dayOfWeek</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#dayOfYear">dayOfYear</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#daysInMonth">daysInMonth</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#daysInYear">daysInYear</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#daysTo">daysTo</a></b> (<i>self</i>, QDate)</li><li><div class="fn" />(int&#160;<i>year</i>, int&#160;<i>month</i>, int&#160;<i>day</i>) <b><a href="qdate.html#getDate">getDate</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#month">month</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#setDate">setDate</a></b> (<i>self</i>, int&#160;<i>year</i>, int&#160;<i>month</i>, int&#160;<i>date</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#setYMD">setYMD</a></b> (<i>self</i>, int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</li><li><div class="fn" />int <b><a href="qdate.html#toJulianDay">toJulianDay</a></b> (<i>self</i>)</li><li><div class="fn" />object <b><a href="qdate.html#toPyDate">toPyDate</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#toString">toString</a></b> (<i>self</i>, Qt.DateFormat&#160;<i>format</i>&#160;=&#160;Qt.TextDate)</li><li><div class="fn" />QString <b><a href="qdate.html#toString-2">toString</a></b> (<i>self</i>, QString&#160;<i>format</i>)</li><li><div class="fn" />(int, int&#160;<i>yearNumber</i>) <b><a href="qdate.html#weekNumber">weekNumber</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdate.html#year">year</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QDate <b><a href="qdate.html#currentDate">currentDate</a></b> ()</li><li><div class="fn" />QDate <b><a href="qdate.html#fromJulianDay">fromJulianDay</a></b> (int&#160;<i>jd</i>)</li><li><div class="fn" />QDate <b><a href="qdate.html#fromString">fromString</a></b> (QString&#160;<i>string</i>, Qt.DateFormat&#160;<i>format</i>&#160;=&#160;Qt.TextDate)</li><li><div class="fn" />QDate <b><a href="qdate.html#fromString-2">fromString</a></b> (QString&#160;<i>s</i>, QString&#160;<i>format</i>)</li><li><div class="fn" />int <b><a href="qdate.html#gregorianToJulian">gregorianToJulian</a></b> (int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#isLeapYear">isLeapYear</a></b> (int&#160;<i>year</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#isValid-2">isValid</a></b> (int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</li><li><div class="fn" />(int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>) <b><a href="qdate.html#julianToGregorian">julianToGregorian</a></b> (int&#160;<i>jd</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#longDayName">longDayName</a></b> (int&#160;<i>weekday</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#longDayName-2">longDayName</a></b> (int&#160;<i>weekday</i>, MonthNameType&#160;<i>type</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#longMonthName">longMonthName</a></b> (int&#160;<i>month</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#longMonthName-2">longMonthName</a></b> (int&#160;<i>month</i>, MonthNameType&#160;<i>type</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#shortDayName">shortDayName</a></b> (int&#160;<i>weekday</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#shortDayName-2">shortDayName</a></b> (int&#160;<i>weekday</i>, MonthNameType&#160;<i>type</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#shortMonthName">shortMonthName</a></b> (int&#160;<i>month</i>)</li><li><div class="fn" />QString <b><a href="qdate.html#shortMonthName-2">shortMonthName</a></b> (int&#160;<i>month</i>, MonthNameType&#160;<i>type</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />int <b><a href="qdate.html#__bool__">__bool__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#__eq__">__eq__</a></b> (<i>self</i>, QDate&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#__ge__">__ge__</a></b> (<i>self</i>, QDate&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#__gt__">__gt__</a></b> (<i>self</i>, QDate&#160;<i>other</i>)</li><li><div class="fn" />int <b><a href="qdate.html#__hash__">__hash__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#__le__">__le__</a></b> (<i>self</i>, QDate&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#__lt__">__lt__</a></b> (<i>self</i>, QDate&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qdate.html#__ne__">__ne__</a></b> (<i>self</i>, QDate&#160;<i>other</i>)</li><li><div class="fn" />object <b><a href="qdate.html#__repr__">__repr__</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><p>A Python date object
    may be used whenever a
    <a href="qdate.html">QDate</a>
    is expected.</p>
  <p>The QDate class provides date functions.</p>
<p>A QDate object contains a calendar date, i.e. year, month, and
day numbers, in the Gregorian calendar. (see <a href="#qdate-g-and-j">Use of Gregorian and Julian Calendars</a> for
dates prior to 15 October 1582). It can read the current date from
the system clock. It provides functions for comparing dates, and
for manipulating dates. For example, it is possible to add and
subtract days, months, and years to dates.</p>
<p>A QDate object is typically created either by giving the year,
month, and day numbers explicitly. Note that QDate interprets two
digit years as is, i.e., years 0 - 99. A QDate can also be
constructed with the static function <a href="qdate.html#currentDate">currentDate</a>(), which creates a QDate
object containing the system clock's date. An explicit date can
also be set using <a href="qdate.html#setDate">setDate</a>(). The
<a href="qdate.html#fromString">fromString</a>() function returns a
QDate given a string and a date format which is used to interpret
the date within the string.</p>
<p>The <a href="qdate.html#year">year</a>(), <a href="qdate.html#month">month</a>(), and <a href="qdate.html#day">day</a>() functions provide access to the year,
month, and day numbers. Also, <a href="qdate.html#dayOfWeek">dayOfWeek</a>() and <a href="qdate.html#dayOfYear">dayOfYear</a>() functions are provided. The
same information is provided in textual format by the <a href="qdate.html#toString">toString</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), <a href="qdate.html#longDayName">longDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>() functions.</p>
<p>QDate provides a full set of operators to compare two QDate
objects where smaller means earlier, and larger means later.</p>
<p>You can increment (or decrement) a date by a given number of
days using <a href="qdate.html#addDays">addDays</a>(). Similarly
you can use <a href="qdate.html#addMonths">addMonths</a>() and
<a href="qdate.html#addYears">addYears</a>(). The <a href="qdate.html#daysTo">daysTo</a>() function returns the number of
days between two dates.</p>
<p>The <a href="qdate.html#daysInMonth">daysInMonth</a>() and
<a href="qdate.html#daysInYear">daysInYear</a>() functions return
how many days there are in this date's month and year,
respectively. The <a href="qdate.html#isLeapYear">isLeapYear</a>()
function indicates whether a date is in a leap year.</p>
<a id="use-of-gregorian-and-julian-calendars" name="use-of-gregorian-and-julian-calendars" /> <a id="qdate-g-and-j" name="qdate-g-and-j" /><a id="use-of-gregorian-and-julian-calendars" name="use-of-gregorian-and-julian-calendars" />
<h4>Use of Gregorian and Julian Calendars</h4>
<p>QDate uses the Gregorian calendar in all locales, beginning on
the date 15 October 1582. For dates up to and including 4 October
1582, the Julian calendar is used. This means there is a 10-day gap
in the internal calendar between the 4th and the 15th of October
1582. When you use <a href="qdatetime.html">QDateTime</a> for dates
in that epoch, the day after 4 October 1582 is 15 October 1582, and
the dates in the gap are invalid.</p>
<p>The Julian to Gregorian changeover date used here is the date
when the Gregorian calendar was first introduced, by Pope Gregory
XIII. That change was not universally accepted and some localities
only executed it at a later date (if at all). <a href="qdatetime.html">QDateTime</a> doesn't take any of these historical
facts into account. If an application must support a
locale-specific dating system, it must do so on its own,
remembering to convert the dates using the Julian day.</p>
<a id="no-year-0" name="no-year-0" />
<h4>No Year 0</h4>
<p>There is no year 0. Dates in that year are considered invalid.
The year -1 is the year "1 before Christ" or "1 before current
era." The day before 0001-01-01 is December 31st, 1 BCE.</p>
<a id="range-of-valid-dates" name="range-of-valid-dates" />
<h4>Range of Valid Dates</h4>
<p>The range of valid dates is from January 2nd, 4713 BCE, to
sometime in the year 11 million CE. The Julian Day returned by
<a href="qdate.html#toJulianDay">QDate.toJulianDay</a>() is a
number in the contiguous range from 1 to <i>overflow</i>, even
across <a href="qdatetime.html">QDateTime</a>'s "date holes". It is
suitable for use in applications that must convert a <a href="qdatetime.html">QDateTime</a> to a date in another calendar
system, e.g., Hebrew, Islamic or Chinese.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="MonthNameType-enum" />QDate.MonthNameType</h3><p>This enum describes the types of the string representation used
for the month name.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDate.DateFormat</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">This type of name can be used for
date-to-string formatting.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDate.StandaloneFormat</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">This type is used when you need to enumerate
months or weekdays. Usually standalone names are represented in
singular forms with capitalized first letter.</td>
</tr>
</table>
<p>This enum was introduced or modified in Qt 4.5.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDate" />QDate.__init__ (<i>self</i>)</h3><p>Constructs a null date. Null dates are invalid.</p>
<p><b>See also</b> <a href="qdate.html#isNull">isNull</a>() and
<a href="qdate.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="QDate-2" />QDate.__init__ (<i>self</i>, int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</h3><p>Constructs a date with year <i>y</i>, month <i>m</i> and day
<i>d</i>.</p>
<p>If the specified date is invalid, the date is not set and
<a href="qdate.html#isValid">isValid</a>() returns false. A date
before 2 January 4713 B.C. is considered invalid.</p>
<p><b>Warning:</b> Years 0 to 99 are interpreted as is, i.e., years
0-99.</p>
<p><b>See also</b> <a href="qdate.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="QDate-3" />QDate.__init__ (<i>self</i>, <a href="qdate.html">QDate</a>)</h3><h3 class="fn"><a name="addDays" /><a href="qdate.html">QDate</a> QDate.addDays (<i>self</i>, int&#160;<i>days</i>)</h3><p>Returns a <a href="qdate.html">QDate</a> object containing a
date <i>ndays</i> later than the date of this object (or earlier if
<i>ndays</i> is negative).</p>
<p><b>See also</b> <a href="qdate.html#addMonths">addMonths</a>(),
<a href="qdate.html#addYears">addYears</a>(), and <a href="qdate.html#daysTo">daysTo</a>().</p>


<h3 class="fn"><a name="addMonths" /><a href="qdate.html">QDate</a> QDate.addMonths (<i>self</i>, int&#160;<i>months</i>)</h3><p>Returns a <a href="qdate.html">QDate</a> object containing a
date <i>nmonths</i> later than the date of this object (or earlier
if <i>nmonths</i> is negative).</p>
<p><b>Note:</b> If the ending day/month combination does not exist
in the resulting month/year, this function will return a date that
is the latest valid date.</p>
<p><b>Warning:</b> <a href="qdate.html">QDate</a> has a date hole
around the days introducing the Gregorian calendar (the days 5 to
14 October 1582, inclusive, do not exist). If the calculation ends
in one of those days, <a href="qdate.html">QDate</a> will return
either October 4 or October 15.</p>
<p><b>See also</b> <a href="qdate.html#addDays">addDays</a>() and
<a href="qdate.html#addYears">addYears</a>().</p>


<h3 class="fn"><a name="addYears" /><a href="qdate.html">QDate</a> QDate.addYears (<i>self</i>, int&#160;<i>years</i>)</h3><p>Returns a <a href="qdate.html">QDate</a> object containing a
date <i>nyears</i> later than the date of this object (or earlier
if <i>nyears</i> is negative).</p>
<p><b>Note:</b> If the ending day/month combination does not exist
in the resulting year (i.e., if the date was Feb 29 and the final
year is not a leap year), this function will return a date that is
the latest valid date (that is, Feb 28).</p>
<p><b>See also</b> <a href="qdate.html#addDays">addDays</a>() and
<a href="qdate.html#addMonths">addMonths</a>().</p>


<h3 class="fn"><a name="currentDate" /><a href="qdate.html">QDate</a> QDate.currentDate ()</h3><p>Returns the current date, as reported by the system clock.</p>
<p><b>See also</b> <a href="qtime.html#currentTime">QTime.currentTime</a>() and <a href="qdatetime.html#currentDateTime">QDateTime.currentDateTime</a>().</p>


<h3 class="fn"><a name="day" />int QDate.day (<i>self</i>)</h3><p>Returns the day of the month (1 to 31) of this date.</p>
<p><b>See also</b> <a href="qdate.html#year">year</a>(), <a href="qdate.html#month">month</a>(), and <a href="qdate.html#dayOfWeek">dayOfWeek</a>().</p>


<h3 class="fn"><a name="dayOfWeek" />int QDate.dayOfWeek (<i>self</i>)</h3><p>Returns the weekday (1 = Monday to 7 = Sunday) for this
date.</p>
<p><b>See also</b> <a href="qdate.html#day">day</a>(), <a href="qdate.html#dayOfYear">dayOfYear</a>(), and <a href="qt.html#DayOfWeek-enum">Qt.DayOfWeek</a>.</p>


<h3 class="fn"><a name="dayOfYear" />int QDate.dayOfYear (<i>self</i>)</h3><p>Returns the day of the year (1 to 365 or 366 on leap years) for
this date.</p>
<p><b>See also</b> <a href="qdate.html#day">day</a>() and <a href="qdate.html#dayOfWeek">dayOfWeek</a>().</p>


<h3 class="fn"><a name="daysInMonth" />int QDate.daysInMonth (<i>self</i>)</h3><p>Returns the number of days in the month (28 to 31) for this
date.</p>
<p><b>See also</b> <a href="qdate.html#day">day</a>() and <a href="qdate.html#daysInYear">daysInYear</a>().</p>


<h3 class="fn"><a name="daysInYear" />int QDate.daysInYear (<i>self</i>)</h3><p>Returns the number of days in the year (365 or 366) for this
date.</p>
<p><b>See also</b> <a href="qdate.html#day">day</a>() and <a href="qdate.html#daysInMonth">daysInMonth</a>().</p>


<h3 class="fn"><a name="daysTo" />int QDate.daysTo (<i>self</i>, <a href="qdate.html">QDate</a>)</h3><p>Returns the number of days from this date to <i>d</i> (which is
negative if <i>d</i> is earlier than this date).</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qdate.html">QDate</a></span> d1(<span class="number">1995</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">17</span>);  <span class="comment">// May 17, 1995</span>
 <span class="type"><a href="qdate.html">QDate</a></span> d2(<span class="number">1995</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">20</span>);  <span class="comment">// May 20, 1995</span>
 d1<span class="operator">.</span>daysTo(d2);          <span class="comment">// returns 3</span>
 d2<span class="operator">.</span>daysTo(d1);          <span class="comment">// returns -3</span>
</pre>
<p><b>See also</b> <a href="qdate.html#addDays">addDays</a>().</p>


<h3 class="fn"><a name="fromJulianDay" /><a href="qdate.html">QDate</a> QDate.fromJulianDay (int&#160;<i>jd</i>)</h3><p>Converts the Julian day <i>jd</i> to a <a href="qdate.html">QDate</a>.</p>
<p><b>See also</b> <a href="qdate.html#toJulianDay">toJulianDay</a>().</p>


<h3 class="fn"><a name="fromString" /><a href="qdate.html">QDate</a> QDate.fromString (QString&#160;<i>string</i>, <a href="qt.html#DateFormat-enum">Qt.DateFormat</a>&#160;<i>format</i>&#160;=&#160;Qt.TextDate)</h3><p>Returns the <a href="qdate.html">QDate</a> represented by the
<i>string</i>, using the <i>format</i> given, or an invalid date if
the string cannot be parsed.</p>
<p>Note for <a href="qt.html#DateFormat-enum">Qt.TextDate</a>: It
is recommended that you use the English short month names (e.g.
"Jan"). Although localized month names can also be used, they
depend on the user's locale settings.</p>


<h3 class="fn"><a name="fromString-2" /><a href="qdate.html">QDate</a> QDate.fromString (QString&#160;<i>s</i>, QString&#160;<i>format</i>)</h3><p>Returns the <a href="qdate.html">QDate</a> represented by the
<i>string</i>, using the <i>format</i> given, or an invalid date if
the string cannot be parsed.</p>
<p>These expressions may be used for the format:</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Expression</th>
<th>Output</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>d</td>
<td>The day as a number without a leading zero (1 to 31)</td>
</tr>
<tr class="even" valign="top">
<td>dd</td>
<td>The day as a number with a leading zero (01 to 31)</td>
</tr>
<tr class="odd" valign="top">
<td>ddd</td>
<td>The abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses
<a href="qdate.html#shortDayName">QDate.shortDayName</a>().</td>
</tr>
<tr class="even" valign="top">
<td>dddd</td>
<td>The long localized day name (e.g. 'Monday' to 'Sunday'). Uses
<a href="qdate.html#longDayName">QDate.longDayName</a>().</td>
</tr>
<tr class="odd" valign="top">
<td>M</td>
<td>The month as a number without a leading zero (1 to 12)</td>
</tr>
<tr class="even" valign="top">
<td>MM</td>
<td>The month as a number with a leading zero (01 to 12)</td>
</tr>
<tr class="odd" valign="top">
<td>MMM</td>
<td>The abbreviated localized month name (e.g. 'Jan' to 'Dec').
Uses <a href="qdate.html#shortMonthName">QDate.shortMonthName</a>().</td>
</tr>
<tr class="even" valign="top">
<td>MMMM</td>
<td>The long localized month name (e.g. 'January' to 'December').
Uses <a href="qdate.html#longMonthName">QDate.longMonthName</a>().</td>
</tr>
<tr class="odd" valign="top">
<td>yy</td>
<td>The year as two digit number (00 to 99)</td>
</tr>
<tr class="even" valign="top">
<td>yyyy</td>
<td>The year as four digit number. If the year is negative, a minus
sign is prepended in addition.</td>
</tr>
</table>
<p>All other input characters will be treated as text. Any sequence
of characters that are enclosed in single quotes will also be
treated as text and will not be used as an expression. For
example:</p>
<pre class="cpp">
 <span class="type"><a href="qdate.html">QDate</a></span> date <span class="operator">=</span> <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#fromString">fromString</a>(<span class="string">"1MM12car2003"</span><span class="operator">,</span> <span class="string">"d'MM'MMcaryyyy"</span>);
 <span class="comment">// date is 1 December 2003</span>
</pre>
<p>If the format is not satisfied, an invalid <a href="qdate.html">QDate</a> is returned. The expressions that don't
expect leading zeroes (d, M) will be greedy. This means that they
will use two digits even if this will put them outside the accepted
range of values and leaves too few digits for other sections. For
example, the following format string could have meant January 30
but the M will grab two digits, resulting in an invalid date:</p>
<pre class="cpp">
 <span class="type"><a href="qdate.html">QDate</a></span> date <span class="operator">=</span> <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#fromString">fromString</a>(<span class="string">"130"</span><span class="operator">,</span> <span class="string">"Md"</span>); <span class="comment">// invalid</span>
</pre>
<p>For any field that is not represented in the format the
following defaults are used:</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Field</th>
<th>Default value</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>Year</td>
<td>1900</td>
</tr>
<tr class="even" valign="top">
<td>Month</td>
<td>1</td>
</tr>
<tr class="odd" valign="top">
<td>Day</td>
<td>1</td>
</tr>
</table>
<p>The following examples demonstrate the default values:</p>
<pre class="cpp">
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#fromString">fromString</a>(<span class="string">"1.30"</span><span class="operator">,</span> <span class="string">"M.d"</span>);           <span class="comment">// January 30 1900</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#fromString">fromString</a>(<span class="string">"20000110"</span><span class="operator">,</span> <span class="string">"yyyyMMdd"</span>);  <span class="comment">// January 10, 2000</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#fromString">fromString</a>(<span class="string">"20000110"</span><span class="operator">,</span> <span class="string">"yyyyMd"</span>);    <span class="comment">// January 10, 2000</span>
</pre>
<p><b>See also</b> <a href="qdatetime.html#fromString">QDateTime.fromString</a>(), <a href="qtime.html#fromString">QTime.fromString</a>(), <a href="qdate.html#toString">QDate.toString</a>(), <a href="qdatetime.html#toString">QDateTime.toString</a>(), and <a href="qtime.html#toString">QTime.toString</a>().</p>


<h3 class="fn"><a name="getDate" />(int&#160;<i>year</i>, int&#160;<i>month</i>, int&#160;<i>day</i>) QDate.getDate (<i>self</i>)</h3><p>Extracts the date's year, month, and day, and assigns them to
*<i>year</i>, *<i>month</i>, and *<i>day</i>. The pointers may be
null.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qdate.html#year">year</a>(), <a href="qdate.html#month">month</a>(), <a href="qdate.html#day">day</a>(),
and <a href="qdate.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="gregorianToJulian" />int QDate.gregorianToJulian (int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</h3><h3 class="fn"><a name="isLeapYear" />bool QDate.isLeapYear (int&#160;<i>year</i>)</h3><p>Returns true if the specified <i>year</i> is a leap year;
otherwise returns false.</p>


<h3 class="fn"><a name="isNull" />bool QDate.isNull (<i>self</i>)</h3><p>Returns true if the date is null; otherwise returns false. A
null date is invalid.</p>
<p><b>Note:</b> The behavior of this function is equivalent to
<a href="qdate.html#isValid">isValid</a>().</p>
<p><b>See also</b> <a href="qdate.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="isValid" />bool QDate.isValid (<i>self</i>)</h3><p>Returns true if this date is valid; otherwise returns false.</p>
<p><b>See also</b> <a href="qdate.html#isNull">isNull</a>().</p>


<h3 class="fn"><a name="isValid-2" />bool QDate.isValid (int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</h3><p>This is an overloaded function.</p>
<p>Returns true if the specified date (<i>year</i>, <i>month</i>,
and <i>day</i>) is valid; otherwise returns false.</p>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2002</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">17</span>);  <span class="comment">// true</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2002</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">30</span>);  <span class="comment">// false (Feb 30 does not exist)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2004</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// true (2004 is a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2000</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// true (2000 is a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2006</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// false (2006 is not a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">2100</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">29</span>);  <span class="comment">// false (2100 is not a leap year)</span>
 <span class="type"><a href="qdate.html">QDate</a></span><span class="operator">.</span><a href="qdate.html#isValid">isValid</a>(<span class="number">1202</span><span class="operator">,</span> <span class="number">6</span><span class="operator">,</span> <span class="number">6</span>);   <span class="comment">// true (even though 1202 is pre-Gregorian)</span>
</pre>
<p><b>See also</b> <a href="qdate.html#isNull">isNull</a>() and
<a href="qdate.html#setDate">setDate</a>().</p>


<h3 class="fn"><a name="julianToGregorian" />(int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>) QDate.julianToGregorian (int&#160;<i>jd</i>)</h3><h3 class="fn"><a name="longDayName" />QString QDate.longDayName (int&#160;<i>weekday</i>)</h3><p>Returns the long version of the name of the <i>weekday</i>. The
returned name is in normal type which can be used for date
formatting.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#shortDayName">shortDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>().</p>


<h3 class="fn"><a name="longDayName-2" />QString QDate.longDayName (int&#160;<i>weekday</i>, <a href="qdate.html#MonthNameType-enum">MonthNameType</a>&#160;<i>type</i>)</h3><p>Returns the long name of the <i>weekday</i> for the
representation specified by <i>type</i>.</p>
<p>The days are enumerated using the following convention:</p>
<ul>
<li>1 = "Monday"</li>
<li>2 = "Tuesday"</li>
<li>3 = "Wednesday"</li>
<li>4 = "Thursday"</li>
<li>5 = "Friday"</li>
<li>6 = "Saturday"</li>
<li>7 = "Sunday"</li>
</ul>
<p>The day names will be localized according to the system's
default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#shortDayName">shortDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>().</p>


<h3 class="fn"><a name="longMonthName" />QString QDate.longMonthName (int&#160;<i>month</i>)</h3><p>Returns the long version of the name of the <i>month</i>. The
returned name is in normal type which can be used for date
formatting.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#shortMonthName">shortMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>


<h3 class="fn"><a name="longMonthName-2" />QString QDate.longMonthName (int&#160;<i>month</i>, <a href="qdate.html#MonthNameType-enum">MonthNameType</a>&#160;<i>type</i>)</h3><p>Returns the long name of the <i>month</i> for the representation
specified by <i>type</i>.</p>
<p>The months are enumerated using the following convention:</p>
<ul>
<li>1 = "January"</li>
<li>2 = "February"</li>
<li>3 = "March"</li>
<li>4 = "April"</li>
<li>5 = "May"</li>
<li>6 = "June"</li>
<li>7 = "July"</li>
<li>8 = "August"</li>
<li>9 = "September"</li>
<li>10 = "October"</li>
<li>11 = "November"</li>
<li>12 = "December"</li>
</ul>
<p>The month names will be localized according to the system's
default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#shortMonthName">shortMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>


<h3 class="fn"><a name="month" />int QDate.month (<i>self</i>)</h3><p>Returns the number corresponding to the month of this date,
using the following convention:</p>
<ul>
<li>1 = "January"</li>
<li>2 = "February"</li>
<li>3 = "March"</li>
<li>4 = "April"</li>
<li>5 = "May"</li>
<li>6 = "June"</li>
<li>7 = "July"</li>
<li>8 = "August"</li>
<li>9 = "September"</li>
<li>10 = "October"</li>
<li>11 = "November"</li>
<li>12 = "December"</li>
</ul>
<p><b>See also</b> <a href="qdate.html#year">year</a>() and
<a href="qdate.html#day">day</a>().</p>


<h3 class="fn"><a name="setDate" />bool QDate.setDate (<i>self</i>, int&#160;<i>year</i>, int&#160;<i>month</i>, int&#160;<i>date</i>)</h3><p>Sets the date's <i>year</i>, <i>month</i>, and <i>day</i>.
Returns true if the date is valid; otherwise returns false.</p>
<p>If the specified date is invalid, the <a href="qdate.html">QDate</a> object is set to be invalid. Any date before
2 January 4713 B.C. is considered invalid.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qdate.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="setYMD" />bool QDate.setYMD (<i>self</i>, int&#160;<i>y</i>, int&#160;<i>m</i>, int&#160;<i>d</i>)</h3><h3 class="fn"><a name="shortDayName" />QString QDate.shortDayName (int&#160;<i>weekday</i>)</h3><p>Returns the short version of the name of the <i>weekday</i>. The
returned name is in normal type which can be used for date
formatting.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#longDayName">longDayName</a>(), <a href="qdate.html#shortMonthName">shortMonthName</a>(), and <a href="qdate.html#longMonthName">longMonthName</a>().</p>


<h3 class="fn"><a name="shortDayName-2" />QString QDate.shortDayName (int&#160;<i>weekday</i>, <a href="qdate.html#MonthNameType-enum">MonthNameType</a>&#160;<i>type</i>)</h3><p>Returns the short name of the <i>weekday</i> for the
representation specified by <i>type</i>.</p>
<p>The days are enumerated using the following convention:</p>
<ul>
<li>1 = "Mon"</li>
<li>2 = "Tue"</li>
<li>3 = "Wed"</li>
<li>4 = "Thu"</li>
<li>5 = "Fri"</li>
<li>6 = "Sat"</li>
<li>7 = "Sun"</li>
</ul>
<p>The day names will be localized according to the system's
default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#shortMonthName">shortMonthName</a>(), <a href="qdate.html#longMonthName">longMonthName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>


<h3 class="fn"><a name="shortMonthName" />QString QDate.shortMonthName (int&#160;<i>month</i>)</h3><p>Returns the short version of the name of the <i>month</i>. The
returned name is in normal type which can be used for date
formatting.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#longMonthName">longMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>


<h3 class="fn"><a name="shortMonthName-2" />QString QDate.shortMonthName (int&#160;<i>month</i>, <a href="qdate.html#MonthNameType-enum">MonthNameType</a>&#160;<i>type</i>)</h3><p>Returns the short name of the <i>month</i> for the
representation specified by <i>type</i>.</p>
<p>The months are enumerated using the following convention:</p>
<ul>
<li>1 = "Jan"</li>
<li>2 = "Feb"</li>
<li>3 = "Mar"</li>
<li>4 = "Apr"</li>
<li>5 = "May"</li>
<li>6 = "Jun"</li>
<li>7 = "Jul"</li>
<li>8 = "Aug"</li>
<li>9 = "Sep"</li>
<li>10 = "Oct"</li>
<li>11 = "Nov"</li>
<li>12 = "Dec"</li>
</ul>
<p>The month names will be localized according to the system's
default locale settings.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qdate.html#toString">toString</a>(),
<a href="qdate.html#longMonthName">longMonthName</a>(), <a href="qdate.html#shortDayName">shortDayName</a>(), and <a href="qdate.html#longDayName">longDayName</a>().</p>


<h3 class="fn"><a name="toJulianDay" />int QDate.toJulianDay (<i>self</i>)</h3><p>Converts the date to a Julian day.</p>
<p><b>See also</b> <a href="qdate.html#fromJulianDay">fromJulianDay</a>().</p>


<h3 class="fn"><a name="toPyDate" />object QDate.toPyDate (<i>self</i>)</h3><h3 class="fn"><a name="toString" />QString QDate.toString (<i>self</i>, <a href="qt.html#DateFormat-enum">Qt.DateFormat</a>&#160;<i>format</i>&#160;=&#160;Qt.TextDate)</h3><p>Returns the date as a string. The <i>format</i> parameter
determines the format of the result string.</p>
<p>These expressions may be used:</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Expression</th>
<th>Output</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>d</td>
<td>the day as number without a leading zero (1 to 31)</td>
</tr>
<tr class="even" valign="top">
<td>dd</td>
<td>the day as number with a leading zero (01 to 31)</td>
</tr>
<tr class="odd" valign="top">
<td>ddd</td>
<td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses
<a href="qdate.html#shortDayName">QDate.shortDayName</a>().</td>
</tr>
<tr class="even" valign="top">
<td>dddd</td>
<td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses
<a href="qdate.html#longDayName">QDate.longDayName</a>().</td>
</tr>
<tr class="odd" valign="top">
<td>M</td>
<td>the month as number without a leading zero (1 to 12)</td>
</tr>
<tr class="even" valign="top">
<td>MM</td>
<td>the month as number with a leading zero (01 to 12)</td>
</tr>
<tr class="odd" valign="top">
<td>MMM</td>
<td>the abbreviated localized month name (e.g. 'Jan' to 'Dec').
Uses <a href="qdate.html#shortMonthName">QDate.shortMonthName</a>().</td>
</tr>
<tr class="even" valign="top">
<td>MMMM</td>
<td>the long localized month name (e.g. 'January' to 'December').
Uses <a href="qdate.html#longMonthName">QDate.longMonthName</a>().</td>
</tr>
<tr class="odd" valign="top">
<td>yy</td>
<td>the year as two digit number (00 to 99)</td>
</tr>
<tr class="even" valign="top">
<td>yyyy</td>
<td>the year as four digit number. If the year is negative, a minus
sign is prepended in addition.</td>
</tr>
</table>
<p>All other input characters will be ignored. Any sequence of
characters that are enclosed in singlequotes will be treated as
text and not be used as an expression. Two consecutive singlequotes
("''") are replaced by a singlequote in the output.</p>
<p>Example format strings (assuming that the <a href="qdate.html">QDate</a> is the 20 July 1969):</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Format</th>
<th>Result</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>dd.MM.yyyy</td>
<td>20.07.1969</td>
</tr>
<tr class="even" valign="top">
<td>ddd MMMM d yy</td>
<td>Sun July 20 69</td>
</tr>
<tr class="odd" valign="top">
<td>'The day is' dddd</td>
<td>The day is Sunday</td>
</tr>
</table>
<p>If the datetime is invalid, an empty string will be
returned.</p>
<p><b>Warning:</b> The <a href="qt.html#DateFormat-enum">Qt.ISODate</a> format is only valid for
years in the range 0 to 9999. This restriction may apply to
locale-aware formats as well, depending on the locale settings.</p>
<p><b>See also</b> <a href="qdatetime.html#toString">QDateTime.toString</a>() and <a href="qtime.html#toString">QTime.toString</a>().</p>


<h3 class="fn"><a name="toString-2" />QString QDate.toString (<i>self</i>, QString&#160;<i>format</i>)</h3><p>This is an overloaded function.</p>
<p>Returns the date as a string. The <i>format</i> parameter
determines the format of the string.</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt.TextDate</a>, the string is formatted
in the default way. <a href="qdate.html#shortDayName">QDate.shortDayName</a>() and <a href="qdate.html#shortMonthName">QDate.shortMonthName</a>() are used to
generate the string, so the day and month names will be localized
names using the default locale from the system. An example of this
formatting is "Sat May 20 1995".</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt.ISODate</a>, the string format
corresponds to the ISO 8601 extended specification for
representations of dates and times, taking the form YYYY-MM-DD,
where YYYY is the year, MM is the month of the year (between 01 and
12), and DD is the day of the month between 01 and 31.</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt.SystemLocaleShortDate</a> or <a href="qt.html#DateFormat-enum">Qt.SystemLocaleLongDate</a>, the string
format depends on the locale settings of the system. Identical to
calling <a href="qlocale.html#system">QLocale.system</a>().toString(date, <a href="qlocale.html#FormatType-enum">QLocale.ShortFormat</a>) or
<a href="qlocale.html#system">QLocale.system</a>().toString(date,
<a href="qlocale.html#FormatType-enum">QLocale.LongFormat</a>).</p>
<p>If the <i>format</i> is <a href="qt.html#DateFormat-enum">Qt.DefaultLocaleShortDate</a> or
<a href="qt.html#DateFormat-enum">Qt.DefaultLocaleLongDate</a>,
the string format depends on the default application locale. This
is the locale set with <a href="qlocale.html#setDefault">QLocale.setDefault</a>(), or the system
locale if no default locale has been set. Identical to calling
QLocale().toString(date, <a href="qlocale.html#FormatType-enum">QLocale.ShortFormat</a>) or
QLocale().toString(date, <a href="qlocale.html#FormatType-enum">QLocale.LongFormat</a>).</p>
<p>If the date is invalid, an empty string will be returned.</p>
<p><b>Warning:</b> The <a href="qt.html#DateFormat-enum">Qt.ISODate</a> format is only valid for
years in the range 0 to 9999. This restriction may apply to
locale-aware formats as well, depending on the locale settings.</p>
<p><b>See also</b> <a href="qdate.html#shortDayName">shortDayName</a>() and <a href="qdate.html#shortMonthName">shortMonthName</a>().</p>


<h3 class="fn"><a name="weekNumber" />(int, int&#160;<i>yearNumber</i>) QDate.weekNumber (<i>self</i>)</h3><p>Returns the week number (1 to 53), and stores the year in
*<i>yearNumber</i> unless <i>yearNumber</i> is null (the
default).</p>
<p>Returns 0 if the date is invalid.</p>
<p>In accordance with ISO 8601, weeks start on Monday and the first
Thursday of a year is always in week 1 of that year. Most years
have 52 weeks, but some have 53.</p>
<p>*<i>yearNumber</i> is not always the same as <a href="qdate.html#year">year</a>(). For example, 1 January 2000 has week
number 52 in the year 1999, and 31 December 2002 has week number 1
in the year 2003.</p>
<p><b>See also</b> <a href="qdate.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="year" />int QDate.year (<i>self</i>)</h3><p>Returns the year of this date. Negative numbers indicate years
before 1 A.D. = 1 C.E., such that year -44 is 44 B.C.</p>
<p><b>See also</b> <a href="qdate.html#month">month</a>() and
<a href="qdate.html#day">day</a>().</p>


<h3 class="fn"><a name="__bool__" />int QDate.__bool__ (<i>self</i>)</h3><h3 class="fn"><a name="__eq__" />bool QDate.__eq__ (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ge__" />bool QDate.__ge__ (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__gt__" />bool QDate.__gt__ (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__hash__" />int QDate.__hash__ (<i>self</i>)</h3><h3 class="fn"><a name="__le__" />bool QDate.__le__ (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__lt__" />bool QDate.__lt__ (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QDate.__ne__ (<i>self</i>, <a href="qdate.html">QDate</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__repr__" />object QDate.__repr__ (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.12.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt&#160;4.8.7</td></tr></table></div></address></body></html>