Repository navigation
Expand file tree
/
Copy pathCalendar.html
More file actions
3897 lines (3846 loc) · 169 KB
/
Copy pathCalendar.html
File metadata and controls
3897 lines (3846 loc) · 169 KB
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
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Calendar (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.util.Calendar class">
<meta name="keywords" content="ERA">
<meta name="keywords" content="YEAR">
<meta name="keywords" content="MONTH">
<meta name="keywords" content="WEEK_OF_YEAR">
<meta name="keywords" content="WEEK_OF_MONTH">
<meta name="keywords" content="DATE">
<meta name="keywords" content="DAY_OF_MONTH">
<meta name="keywords" content="DAY_OF_YEAR">
<meta name="keywords" content="DAY_OF_WEEK">
<meta name="keywords" content="DAY_OF_WEEK_IN_MONTH">
<meta name="keywords" content="AM_PM">
<meta name="keywords" content="HOUR">
<meta name="keywords" content="HOUR_OF_DAY">
<meta name="keywords" content="MINUTE">
<meta name="keywords" content="SECOND">
<meta name="keywords" content="MILLISECOND">
<meta name="keywords" content="ZONE_OFFSET">
<meta name="keywords" content="DST_OFFSET">
<meta name="keywords" content="FIELD_COUNT">
<meta name="keywords" content="SUNDAY">
<meta name="keywords" content="MONDAY">
<meta name="keywords" content="TUESDAY">
<meta name="keywords" content="WEDNESDAY">
<meta name="keywords" content="THURSDAY">
<meta name="keywords" content="FRIDAY">
<meta name="keywords" content="SATURDAY">
<meta name="keywords" content="JANUARY">
<meta name="keywords" content="FEBRUARY">
<meta name="keywords" content="MARCH">
<meta name="keywords" content="APRIL">
<meta name="keywords" content="MAY">
<meta name="keywords" content="JUNE">
<meta name="keywords" content="JULY">
<meta name="keywords" content="AUGUST">
<meta name="keywords" content="SEPTEMBER">
<meta name="keywords" content="OCTOBER">
<meta name="keywords" content="NOVEMBER">
<meta name="keywords" content="DECEMBER">
<meta name="keywords" content="UNDECIMBER">
<meta name="keywords" content="AM">
<meta name="keywords" content="PM">
<meta name="keywords" content="ALL_STYLES">
<meta name="keywords" content="SHORT">
<meta name="keywords" content="LONG">
<meta name="keywords" content="NARROW_FORMAT">
<meta name="keywords" content="NARROW_STANDALONE">
<meta name="keywords" content="SHORT_FORMAT">
<meta name="keywords" content="LONG_FORMAT">
<meta name="keywords" content="SHORT_STANDALONE">
<meta name="keywords" content="LONG_STANDALONE">
<meta name="keywords" content="fields">
<meta name="keywords" content="isSet">
<meta name="keywords" content="time">
<meta name="keywords" content="isTimeSet">
<meta name="keywords" content="areFieldsSet">
<meta name="keywords" content="getInstance()">
<meta name="keywords" content="getAvailableLocales()">
<meta name="keywords" content="computeTime()">
<meta name="keywords" content="computeFields()">
<meta name="keywords" content="getTime()">
<meta name="keywords" content="setTime()">
<meta name="keywords" content="getTimeInMillis()">
<meta name="keywords" content="setTimeInMillis()">
<meta name="keywords" content="get()">
<meta name="keywords" content="internalGet()">
<meta name="keywords" content="set()">
<meta name="keywords" content="clear()">
<meta name="keywords" content="isSet()">
<meta name="keywords" content="getDisplayName()">
<meta name="keywords" content="getDisplayNames()">
<meta name="keywords" content="complete()">
<meta name="keywords" content="getAvailableCalendarTypes()">
<meta name="keywords" content="getCalendarType()">
<meta name="keywords" content="equals()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="before()">
<meta name="keywords" content="after()">
<meta name="keywords" content="compareTo()">
<meta name="keywords" content="add()">
<meta name="keywords" content="roll()">
<meta name="keywords" content="setTimeZone()">
<meta name="keywords" content="getTimeZone()">
<meta name="keywords" content="setLenient()">
<meta name="keywords" content="isLenient()">
<meta name="keywords" content="setFirstDayOfWeek()">
<meta name="keywords" content="getFirstDayOfWeek()">
<meta name="keywords" content="setMinimalDaysInFirstWeek()">
<meta name="keywords" content="getMinimalDaysInFirstWeek()">
<meta name="keywords" content="isWeekDateSupported()">
<meta name="keywords" content="getWeekYear()">
<meta name="keywords" content="setWeekDate()">
<meta name="keywords" content="getWeeksInWeekYear()">
<meta name="keywords" content="getMinimum()">
<meta name="keywords" content="getMaximum()">
<meta name="keywords" content="getGreatestMinimum()">
<meta name="keywords" content="getLeastMaximum()">
<meta name="keywords" content="getActualMinimum()">
<meta name="keywords" content="getActualMaximum()">
<meta name="keywords" content="clone()">
<meta name="keywords" content="toString()">
<meta name="keywords" content="toInstant()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Calendar (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":6,"i9":6,"i10":10,"i11":10,"i12":10,"i13":10,"i14":9,"i15":9,"i16":10,"i17":10,"i18":10,"i19":10,"i20":6,"i21":9,"i22":9,"i23":9,"i24":9,"i25":6,"i26":6,"i27":10,"i28":6,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":6,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Calendar.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span> <a href="../../module-summary.html">java.base</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">java.util</a></div>
<h2 title="Class Calendar" class="title">Class Calendar</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="../lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>java.util.Calendar</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="../io/Serializable.html" title="interface in java.io">Serializable</a></code>, <code><a href="../lang/Cloneable.html" title="interface in java.lang">Cloneable</a></code>, <code><a href="../lang/Comparable.html" title="interface in java.lang">Comparable</a><<a href="Calendar.html" title="class in java.util">Calendar</a>></code></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="GregorianCalendar.html" title="class in java.util">GregorianCalendar</a></code></dd>
</dl>
<hr>
<pre>public abstract class <span class="typeNameLabel">Calendar</span>
extends <a href="../lang/Object.html" title="class in java.lang">Object</a>
implements <a href="../io/Serializable.html" title="interface in java.io">Serializable</a>, <a href="../lang/Cloneable.html" title="interface in java.lang">Cloneable</a>, <a href="../lang/Comparable.html" title="interface in java.lang">Comparable</a><<a href="Calendar.html" title="class in java.util">Calendar</a>></pre>
<div class="block">The <code>Calendar</code> class is an abstract class that provides methods
for converting between a specific instant in time and a set of <a href="#fields"><code>calendar fields</code></a> such as <code>YEAR</code>, <code>MONTH</code>,
<code>DAY_OF_MONTH</code>, <code>HOUR</code>, and so on, and for
manipulating the calendar fields, such as getting the date of the next
week. An instant in time can be represented by a millisecond value that is
an offset from the <a id="Epoch"><em>Epoch</em></a>, January 1, 1970
00:00:00.000 GMT (Gregorian).
<p>The class also provides additional fields and methods for
implementing a concrete calendar system outside the package. Those
fields and methods are defined as <code>protected</code>.
<p>
Like other locale-sensitive classes, <code>Calendar</code> provides a
class method, <code>getInstance</code>, for getting a generally useful
object of this type. <code>Calendar</code>'s <code>getInstance</code> method
returns a <code>Calendar</code> object whose
calendar fields have been initialized with the current date and time:
<blockquote>
<pre>
Calendar rightNow = Calendar.getInstance();
</pre>
</blockquote>
<p>A <code>Calendar</code> object can produce all the calendar field values
needed to implement the date-time formatting for a particular language and
calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
<code>Calendar</code> defines the range of values returned by
certain calendar fields, as well as their meaning. For example,
the first month of the calendar system has value <code>MONTH ==
JANUARY</code> for all calendars. Other values are defined by the
concrete subclass, such as <code>ERA</code>. See individual field
documentation and subclass documentation for details.
<h3>Getting and Setting Calendar Field Values</h3>
<p>The calendar field values can be set by calling the <code>set</code>
methods. Any field values set in a <code>Calendar</code> will not be
interpreted until it needs to calculate its time value (milliseconds from
the Epoch) or values of the calendar fields. Calling the
<code>get</code>, <code>getTimeInMillis</code>, <code>getTime</code>,
<code>add</code> and <code>roll</code> involves such calculation.
<h4>Leniency</h4>
<p><code>Calendar</code> has two modes for interpreting the calendar
fields, <em>lenient</em> and <em>non-lenient</em>. When a
<code>Calendar</code> is in lenient mode, it accepts a wider range of
calendar field values than it produces. When a <code>Calendar</code>
recomputes calendar field values for return by <code>get()</code>, all of
the calendar fields are normalized. For example, a lenient
<code>GregorianCalendar</code> interprets <code>MONTH == JANUARY</code>,
<code>DAY_OF_MONTH == 32</code> as February 1.
<p>When a <code>Calendar</code> is in non-lenient mode, it throws an
exception if there is any inconsistency in its calendar fields. For
example, a <code>GregorianCalendar</code> always produces
<code>DAY_OF_MONTH</code> values between 1 and the length of the month. A
non-lenient <code>GregorianCalendar</code> throws an exception upon
calculating its time or calendar field values if any out-of-range field
value has been set.
<h4><a id="first_week">First Week</a></h4>
<code>Calendar</code> defines a locale-specific seven day week using two
parameters: the first day of the week and the minimal days in first week
(from 1 to 7). These numbers are taken from the locale resource data or the
locale itself when a <code>Calendar</code> is constructed. If the designated
locale contains "fw" and/or "rg" <a href="./Locale.html#def_locale_extension">
Unicode extensions</a>, the first day of the week will be obtained according to
those extensions. If both "fw" and "rg" are specified, the value from the "fw"
extension supersedes the implicit one from the "rg" extension.
They may also be specified explicitly through the methods for setting their
values.
<p>When setting or getting the <code>WEEK_OF_MONTH</code> or
<code>WEEK_OF_YEAR</code> fields, <code>Calendar</code> must determine the
first week of the month or year as a reference point. The first week of a
month or year is defined as the earliest seven day period beginning on
<code>getFirstDayOfWeek()</code> and containing at least
<code>getMinimalDaysInFirstWeek()</code> days of that month or year. Weeks
numbered ..., -1, 0 precede the first week; weeks numbered 2, 3,... follow
it. Note that the normalized numbering returned by <code>get()</code> may be
different. For example, a specific <code>Calendar</code> subclass may
designate the week before week 1 of a year as week <code><i>n</i></code> of
the previous year.
<h4>Calendar Fields Resolution</h4>
When computing a date and time from the calendar fields, there
may be insufficient information for the computation (such as only
year and month with no day of month), or there may be inconsistent
information (such as Tuesday, July 15, 1996 (Gregorian) -- July 15,
1996 is actually a Monday). <code>Calendar</code> will resolve
calendar field values to determine the date and time in the
following way.
<p><a id="resolution">If there is any conflict in calendar field values,
<code>Calendar</code> gives priorities to calendar fields that have been set
more recently.</a> The following are the default combinations of the
calendar fields. The most recent combination, as determined by the
most recently set single field, will be used.
<p><a id="date_resolution">For the date fields</a>:
<blockquote>
<pre>
YEAR + MONTH + DAY_OF_MONTH
YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
YEAR + DAY_OF_YEAR
YEAR + DAY_OF_WEEK + WEEK_OF_YEAR
</pre></blockquote>
<a id="time_resolution">For the time of day fields</a>:
<blockquote>
<pre>
HOUR_OF_DAY
AM_PM + HOUR
</pre></blockquote>
<p>If there are any calendar fields whose values haven't been set in the selected
field combination, <code>Calendar</code> uses their default values. The default
value of each field may vary by concrete calendar systems. For example, in
<code>GregorianCalendar</code>, the default of a field is the same as that
of the start of the Epoch: i.e., <code>YEAR = 1970</code>, <code>MONTH =
JANUARY</code>, <code>DAY_OF_MONTH = 1</code>, etc.
<p>
<strong>Note:</strong> There are certain possible ambiguities in
interpretation of certain singular times, which are resolved in the
following ways:
<ol>
<li> 23:59 is the last minute of the day and 00:00 is the first
minute of the next day. Thus, 23:59 on Dec 31, 1999 < 00:00 on
Jan 1, 2000 < 00:01 on Jan 1, 2000.
<li> Although historically not precise, midnight also belongs to "am",
and noon belongs to "pm", so on the same day,
12:00 am (midnight) < 12:01 am, and 12:00 pm (noon) < 12:01 pm
</ol>
<p>
The date or time format strings are not part of the definition of a
calendar, as those must be modifiable or overridable by the user at
runtime. Use <a href="../text/DateFormat.html" title="class in java.text"><code>DateFormat</code></a>
to format dates.
<h4>Field Manipulation</h4>
The calendar fields can be changed using three methods:
<code>set()</code>, <code>add()</code>, and <code>roll()</code>.
<p><strong><code>set(f, value)</code></strong> changes calendar field
<code>f</code> to <code>value</code>. In addition, it sets an
internal member variable to indicate that calendar field <code>f</code> has
been changed. Although calendar field <code>f</code> is changed immediately,
the calendar's time value in milliseconds is not recomputed until the next call to
<code>get()</code>, <code>getTime()</code>, <code>getTimeInMillis()</code>,
<code>add()</code>, or <code>roll()</code> is made. Thus, multiple calls to
<code>set()</code> do not trigger multiple, unnecessary
computations. As a result of changing a calendar field using
<code>set()</code>, other calendar fields may also change, depending on the
calendar field, the calendar field value, and the calendar system. In addition,
<code>get(f)</code> will not necessarily return <code>value</code> set by
the call to the <code>set</code> method
after the calendar fields have been recomputed. The specifics are determined by
the concrete calendar class.</p>
<p><em>Example</em>: Consider a <code>GregorianCalendar</code>
originally set to August 31, 1999. Calling <code>set(Calendar.MONTH,
Calendar.SEPTEMBER)</code> sets the date to September 31,
1999. This is a temporary internal representation that resolves to
October 1, 1999 if <code>getTime()</code>is then called. However, a
call to <code>set(Calendar.DAY_OF_MONTH, 30)</code> before the call to
<code>getTime()</code> sets the date to September 30, 1999, since
no recomputation occurs after <code>set()</code> itself.</p>
<p><strong><code>add(f, delta)</code></strong> adds <code>delta</code>
to field <code>f</code>. This is equivalent to calling <code>set(f,
get(f) + delta)</code> with two adjustments:</p>
<blockquote>
<p><strong>Add rule 1</strong>. The value of field <code>f</code>
after the call minus the value of field <code>f</code> before the
call is <code>delta</code>, modulo any overflow that has occurred in
field <code>f</code>. Overflow occurs when a field value exceeds its
range and, as a result, the next larger field is incremented or
decremented and the field value is adjusted back into its range.</p>
<p><strong>Add rule 2</strong>. If a smaller field is expected to be
invariant, but it is impossible for it to be equal to its
prior value because of changes in its minimum or maximum after field
<code>f</code> is changed or other constraints, such as time zone
offset changes, then its value is adjusted to be as close
as possible to its expected value. A smaller field represents a
smaller unit of time. <code>HOUR</code> is a smaller field than
<code>DAY_OF_MONTH</code>. No adjustment is made to smaller fields
that are not expected to be invariant. The calendar system
determines what fields are expected to be invariant.</p>
</blockquote>
<p>In addition, unlike <code>set()</code>, <code>add()</code> forces
an immediate recomputation of the calendar's milliseconds and all
fields.</p>
<p><em>Example</em>: Consider a <code>GregorianCalendar</code>
originally set to August 31, 1999. Calling <code>add(Calendar.MONTH,
13)</code> sets the calendar to September 30, 2000. <strong>Add rule
1</strong> sets the <code>MONTH</code> field to September, since
adding 13 months to August gives September of the next year. Since
<code>DAY_OF_MONTH</code> cannot be 31 in September in a
<code>GregorianCalendar</code>, <strong>add rule 2</strong> sets the
<code>DAY_OF_MONTH</code> to 30, the closest possible value. Although
it is a smaller field, <code>DAY_OF_WEEK</code> is not adjusted by
rule 2, since it is expected to change when the month changes in a
<code>GregorianCalendar</code>.</p>
<p><strong><code>roll(f, delta)</code></strong> adds
<code>delta</code> to field <code>f</code> without changing larger
fields. This is equivalent to calling <code>add(f, delta)</code> with
the following adjustment:</p>
<blockquote>
<p><strong>Roll rule</strong>. Larger fields are unchanged after the
call. A larger field represents a larger unit of
time. <code>DAY_OF_MONTH</code> is a larger field than
<code>HOUR</code>.</p>
</blockquote>
<p><em>Example</em>: See <a href="GregorianCalendar.html#roll(int,int)"><code>GregorianCalendar.roll(int, int)</code></a>.
<p><strong>Usage model</strong>. To motivate the behavior of
<code>add()</code> and <code>roll()</code>, consider a user interface
component with increment and decrement buttons for the month, day, and
year, and an underlying <code>GregorianCalendar</code>. If the
interface reads January 31, 1999 and the user presses the month
increment button, what should it read? If the underlying
implementation uses <code>set()</code>, it might read March 3, 1999. A
better result would be February 28, 1999. Furthermore, if the user
presses the month increment button again, it should read March 31,
1999, not March 28, 1999. By saving the original date and using either
<code>add()</code> or <code>roll()</code>, depending on whether larger
fields should be affected, the user interface can behave as most users
will intuitively expect.</p></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../lang/System.html#currentTimeMillis()"><code>System.currentTimeMillis()</code></a>,
<a href="Date.html" title="class in java.util"><code>Date</code></a>,
<a href="GregorianCalendar.html" title="class in java.util"><code>GregorianCalendar</code></a>,
<a href="TimeZone.html" title="class in java.util"><code>TimeZone</code></a>,
<a href="../text/DateFormat.html" title="class in java.text"><code>DateFormat</code></a>,
<a href="../../../serialized-form.html#java.util.Calendar">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<div class="memberSummary">
<table>
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Calendar.Builder.html" title="class in java.util">Calendar.Builder</a></span></code></th>
<td class="colLast">
<div class="block"><code>Calendar.Builder</code> is used for creating a <code>Calendar</code> from
various date-time parameters.</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
</section>
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<div class="memberSummary">
<table>
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ALL_STYLES">ALL_STYLES</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating names in all styles, such as
"January" and "Jan".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#AM">AM</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#AM_PM"><code>AM_PM</code></a> field indicating the
period of the day from midnight to just before noon.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#AM_PM">AM_PM</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating
whether the <code>HOUR</code> is before or after noon.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#APRIL">APRIL</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
fourth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#areFieldsSet">areFieldsSet</a></span></code></th>
<td class="colLast">
<div class="block">True if <code>fields[]</code> are in sync with the currently set time.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#AUGUST">AUGUST</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
eighth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DATE">DATE</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
day of the month.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DAY_OF_MONTH">DAY_OF_MONTH</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
day of the month.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DAY_OF_WEEK">DAY_OF_WEEK</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the day
of the week.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DAY_OF_WEEK_IN_MONTH">DAY_OF_WEEK_IN_MONTH</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
ordinal number of the day of the week within the current month.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DAY_OF_YEAR">DAY_OF_YEAR</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the day
number within the current year.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DECEMBER">DECEMBER</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
twelfth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DST_OFFSET">DST_OFFSET</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
daylight saving offset in milliseconds.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ERA">ERA</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
era, e.g., AD or BC in the Julian calendar.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#FEBRUARY">FEBRUARY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
second month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#FIELD_COUNT">FIELD_COUNT</a></span></code></th>
<td class="colLast">
<div class="block">The number of distinct fields recognized by <code>get</code> and <code>set</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fields">fields</a></span></code></th>
<td class="colLast">
<div class="block">The calendar field values for the currently set time for this calendar.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#FRIDAY">FRIDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Friday.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#HOUR">HOUR</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
hour of the morning or afternoon.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#HOUR_OF_DAY">HOUR_OF_DAY</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
hour of the day.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSet">isSet</a></span></code></th>
<td class="colLast">
<div class="block">The flags which tell if a specified calendar field for the calendar is set.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isTimeSet">isTimeSet</a></span></code></th>
<td class="colLast">
<div class="block">True if then the value of <code>time</code> is valid.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JANUARY">JANUARY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
first month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JULY">JULY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
seventh month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#JUNE">JUNE</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
sixth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#LONG">LONG</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> equivalent to <a href="#LONG_FORMAT"><code>LONG_FORMAT</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#LONG_FORMAT">LONG_FORMAT</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating a long name used for format.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#LONG_STANDALONE">LONG_STANDALONE</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating a long name used independently,
such as a month name as calendar headers.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MARCH">MARCH</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
third month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MAY">MAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
fifth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MILLISECOND">MILLISECOND</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
millisecond within the second.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MINUTE">MINUTE</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
minute within the hour.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MONDAY">MONDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Monday.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MONTH">MONTH</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
month.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#NARROW_FORMAT">NARROW_FORMAT</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating a narrow name used for format.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#NARROW_STANDALONE">NARROW_STANDALONE</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating a narrow name independently.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#NOVEMBER">NOVEMBER</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
eleventh month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OCTOBER">OCTOBER</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
tenth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PM">PM</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#AM_PM"><code>AM_PM</code></a> field indicating the
period of the day from noon to just before midnight.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SATURDAY">SATURDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Saturday.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SECOND">SECOND</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
second within the minute.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SEPTEMBER">SEPTEMBER</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
ninth month of the year in the Gregorian and Julian calendars.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SHORT">SHORT</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> equivalent to <a href="#SHORT_FORMAT"><code>SHORT_FORMAT</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SHORT_FORMAT">SHORT_FORMAT</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating a short name used for format.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SHORT_STANDALONE">SHORT_STANDALONE</a></span></code></th>
<td class="colLast">
<div class="block">A style specifier for <a href="#getDisplayName(int,int,java.util.Locale)"><code>getDisplayName</code></a> and <a href="#getDisplayNames(int,int,java.util.Locale)"><code>getDisplayNames</code></a> indicating a short name used independently,
such as a month abbreviation as calendar headers.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SUNDAY">SUNDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Sunday.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#THURSDAY">THURSDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Thursday.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#time">time</a></span></code></th>
<td class="colLast">
<div class="block">The currently set time for this calendar, expressed in milliseconds after
January 1, 1970, 0:00:00 GMT.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#TUESDAY">TUESDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Tuesday.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#UNDECIMBER">UNDECIMBER</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#MONTH"><code>MONTH</code></a> field indicating the
thirteenth month of the year.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#WEDNESDAY">WEDNESDAY</a></span></code></th>
<td class="colLast">
<div class="block">Value of the <a href="#DAY_OF_WEEK"><code>DAY_OF_WEEK</code></a> field indicating
Wednesday.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#WEEK_OF_MONTH">WEEK_OF_MONTH</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
week number within the current month.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#WEEK_OF_YEAR">WEEK_OF_YEAR</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
week number within the current year.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#YEAR">YEAR</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code> indicating the
year.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ZONE_OFFSET">ZONE_OFFSET</a></span></code></th>
<td class="colLast">
<div class="block">Field number for <code>get</code> and <code>set</code>
indicating the raw offset from GMT in milliseconds.</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<div class="memberSummary">
<table>
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colSecond" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Calendar</a></span>()</code></th>
<td class="colLast">
<div class="block">Constructs a Calendar with the default time zone
and the default <a href="Locale.Category.html#FORMAT"><code>FORMAT</code></a>
locale.</div>
</td>
</tr>