forked from bjmashibing/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDate.html
More file actions
1766 lines (1766 loc) · 78.8 KB
/
Date.html
File metadata and controls
1766 lines (1766 loc) · 78.8 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>Date (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.util.Date class">
<meta name="keywords" content="clone()">
<meta name="keywords" content="UTC()">
<meta name="keywords" content="parse()">
<meta name="keywords" content="getYear()">
<meta name="keywords" content="setYear()">
<meta name="keywords" content="getMonth()">
<meta name="keywords" content="setMonth()">
<meta name="keywords" content="getDate()">
<meta name="keywords" content="setDate()">
<meta name="keywords" content="getDay()">
<meta name="keywords" content="getHours()">
<meta name="keywords" content="setHours()">
<meta name="keywords" content="getMinutes()">
<meta name="keywords" content="setMinutes()">
<meta name="keywords" content="getSeconds()">
<meta name="keywords" content="setSeconds()">
<meta name="keywords" content="getTime()">
<meta name="keywords" content="setTime()">
<meta name="keywords" content="before()">
<meta name="keywords" content="after()">
<meta name="keywords" content="equals()">
<meta name="keywords" content="compareTo()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="toString()">
<meta name="keywords" content="toLocaleString()">
<meta name="keywords" content="toGMTString()">
<meta name="keywords" content="getTimezoneOffset()">
<meta name="keywords" content="from()">
<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="Date (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":42,"i7":42,"i8":42,"i9":42,"i10":42,"i11":42,"i12":10,"i13":42,"i14":42,"i15":10,"i16":41,"i17":42,"i18":42,"i19":42,"i20":42,"i21":42,"i22":10,"i23":42,"i24":42,"i25":10,"i26":42,"i27":10,"i28":41};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/Date.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>Nested | </li>
<li>Field | </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>Field | </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 Date" class="title">Class Date</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.Date</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="Date.html" title="class in java.util">Date</a>></code></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="../../../java.sql/java/sql/Date.html" title="class in java.sql">Date</a></code>, <code><a href="../../../java.sql/java/sql/Time.html" title="class in java.sql">Time</a></code>, <code><a href="../../../java.sql/java/sql/Timestamp.html" title="class in java.sql">Timestamp</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">Date</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="Date.html" title="class in java.util">Date</a>></pre>
<div class="block">The class <code>Date</code> represents a specific instant
in time, with millisecond precision.
<p>
Prior to JDK 1.1, the class <code>Date</code> had two additional
functions. It allowed the interpretation of dates as year, month, day, hour,
minute, and second values. It also allowed the formatting and parsing
of date strings. Unfortunately, the API for these functions was not
amenable to internationalization. As of JDK 1.1, the
<code>Calendar</code> class should be used to convert between dates and time
fields and the <code>DateFormat</code> class should be used to format and
parse date strings.
The corresponding methods in <code>Date</code> are deprecated.
<p>
Although the <code>Date</code> class is intended to reflect
coordinated universal time (UTC), it may not do so exactly,
depending on the host environment of the Java Virtual Machine.
Nearly all modern operating systems assume that 1 day =
24 × 60 × 60 = 86400 seconds
in all cases. In UTC, however, about once every year or two there
is an extra second, called a "leap second." The leap
second is always added as the last second of the day, and always
on December 31 or June 30. For example, the last minute of the
year 1995 was 61 seconds long, thanks to an added leap second.
Most computer clocks are not accurate enough to be able to reflect
the leap-second distinction.
<p>
Some computer standards are defined in terms of Greenwich mean
time (GMT), which is equivalent to universal time (UT). GMT is
the "civil" name for the standard; UT is the
"scientific" name for the same standard. The
distinction between UTC and UT is that UTC is based on an atomic
clock and UT is based on astronomical observations, which for all
practical purposes is an invisibly fine hair to split. Because the
earth's rotation is not uniform (it slows down and speeds up
in complicated ways), UT does not always flow uniformly. Leap
seconds are introduced as needed into UTC so as to keep UTC within
0.9 seconds of UT1, which is a version of UT with certain
corrections applied. There are other time and date systems as
well; for example, the time scale used by the satellite-based
global positioning system (GPS) is synchronized to UTC but is
<i>not</i> adjusted for leap seconds. An interesting source of
further information is the United States Naval Observatory (USNO):
<blockquote><pre>
<a href="https://www.usno.navy.mil/USNO">https://www.usno.navy.mil/USNO</a>
</pre></blockquote>
<p>
and the material regarding "Systems of Time" at:
<blockquote><pre>
<a href="https://www.usno.navy.mil/USNO/time/master-clock/systems-of-time">https://www.usno.navy.mil/USNO/time/master-clock/systems-of-time</a>
</pre></blockquote>
<p>
which has descriptions of various different time systems including
UT, UT1, and UTC.
<p>
In all methods of class <code>Date</code> that accept or return
year, month, date, hours, minutes, and seconds values, the
following representations are used:
<ul>
<li>A year <i>y</i> is represented by the integer
<i>y</i> <code>- 1900</code>.
<li>A month is represented by an integer from 0 to 11; 0 is January,
1 is February, and so forth; thus 11 is December.
<li>A date (day of month) is represented by an integer from 1 to 31
in the usual manner.
<li>An hour is represented by an integer from 0 to 23. Thus, the hour
from midnight to 1 a.m. is hour 0, and the hour from noon to 1
p.m. is hour 12.
<li>A minute is represented by an integer from 0 to 59 in the usual manner.
<li>A second is represented by an integer from 0 to 61; the values 60 and
61 occur only for leap seconds and even then only in Java
implementations that actually track leap seconds correctly. Because
of the manner in which leap seconds are currently introduced, it is
extremely unlikely that two leap seconds will occur in the same
minute, but this specification follows the date and time conventions
for ISO C.
</ul>
<p>
In all cases, arguments given to methods for these purposes need
not fall within the indicated ranges; for example, a date may be
specified as January 32 and is interpreted as meaning February 1.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../text/DateFormat.html" title="class in java.text"><code>DateFormat</code></a>,
<a href="Calendar.html" title="class in java.util"><code>Calendar</code></a>,
<a href="TimeZone.html" title="class in java.util"><code>TimeZone</code></a>,
<a href="../../../serialized-form.html#java.util.Date">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== 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">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Date</a></span>()</code></th>
<td class="colLast">
<div class="block">Allocates a <code>Date</code> object and initializes it so that
it represents the time at which it was allocated, measured to the
nearest millisecond.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,int,int)">Date</a></span>​(int year,
int month,
int date)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date)</code>
or <code>GregorianCalendar(year + 1900, month, date)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,int,int,int,int)">Date</a></span>​(int year,
int month,
int date,
int hrs,
int min)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date, hrs, min)</code>
or <code>GregorianCalendar(year + 1900, month, date, hrs, min)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,int,int,int,int,int)">Date</a></span>​(int year,
int month,
int date,
int hrs,
int min,
int sec)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date, hrs, min, sec)</code>
or <code>GregorianCalendar(year + 1900, month, date, hrs, min, sec)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(long)">Date</a></span>​(long date)</code></th>
<td class="colLast">
<div class="block">Allocates a <code>Date</code> object and initializes it to
represent the specified number of milliseconds since the
standard base time known as "the epoch", namely January 1,
1970, 00:00:00 GMT.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.lang.String)">Date</a></span>​(<a href="../lang/String.html" title="class in java.lang">String</a> s)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>DateFormat.parse(String s)</code>.</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t6" class="tableTab" onclick="show(32);">Deprecated Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#after(java.util.Date)">after</a></span>​(<a href="Date.html" title="class in java.util">Date</a> when)</code></th>
<td class="colLast">
<div class="block">Tests if this date is after the specified date.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#before(java.util.Date)">before</a></span>​(<a href="Date.html" title="class in java.util">Date</a> when)</code></th>
<td class="colLast">
<div class="block">Tests if this date is before the specified date.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><a href="../lang/Object.html" title="class in java.lang">Object</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clone()">clone</a></span>()</code></th>
<td class="colLast">
<div class="block">Return a copy of this object.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compareTo(java.util.Date)">compareTo</a></span>​(<a href="Date.html" title="class in java.util">Date</a> anotherDate)</code></th>
<td class="colLast">
<div class="block">Compares two Dates for ordering.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>​(<a href="../lang/Object.html" title="class in java.lang">Object</a> obj)</code></th>
<td class="colLast">
<div class="block">Compares two dates for equality.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>static <a href="Date.html" title="class in java.util">Date</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#from(java.time.Instant)">from</a></span>​(<a href="../time/Instant.html" title="class in java.time">Instant</a> instant)</code></th>
<td class="colLast">
<div class="block">Obtains an instance of <code>Date</code> from an <code>Instant</code> object.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDate()">getDate</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.DAY_OF_MONTH)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDay()">getDay</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.DAY_OF_WEEK)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getHours()">getHours</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.HOUR_OF_DAY)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMinutes()">getMinutes</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.MINUTE)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMonth()">getMonth</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.MONTH)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSeconds()">getSeconds</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.SECOND)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTime()">getTime</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT
represented by this <code>Date</code> object.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTimezoneOffset()">getTimezoneOffset</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>-(Calendar.get(Calendar.ZONE_OFFSET) +
Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getYear()">getYear</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.get(Calendar.YEAR) - 1900</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a hash code value for this object.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>static long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parse(java.lang.String)">parse</a></span>​(<a href="../lang/String.html" title="class in java.lang">String</a> s)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>DateFormat.parse(String s)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDate(int)">setDate</a></span>​(int date)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(Calendar.DAY_OF_MONTH, int date)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setHours(int)">setHours</a></span>​(int hours)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(Calendar.HOUR_OF_DAY, int hours)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMinutes(int)">setMinutes</a></span>​(int minutes)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(Calendar.MINUTE, int minutes)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setMonth(int)">setMonth</a></span>​(int month)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(Calendar.MONTH, int month)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i21">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSeconds(int)">setSeconds</a></span>​(int seconds)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(Calendar.SECOND, int seconds)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i22">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTime(long)">setTime</a></span>​(long time)</code></th>
<td class="colLast">
<div class="block">Sets this <code>Date</code> object to represent a point in time that is
<code>time</code> milliseconds after January 1, 1970 00:00:00 GMT.</div>
</td>
</tr>
<tr class="rowColor" id="i23">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setYear(int)">setYear</a></span>​(int year)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(Calendar.YEAR, year + 1900)</code>.</div>
</div>
</td>
</tr>
<tr class="altColor" id="i24">
<td class="colFirst"><code><a href="../lang/String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toGMTString()">toGMTString</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>DateFormat.format(Date date)</code>, using a
GMT <code>TimeZone</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i25">
<td class="colFirst"><code><a href="../time/Instant.html" title="class in java.time">Instant</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toInstant()">toInstant</a></span>()</code></th>
<td class="colLast">
<div class="block">Converts this <code>Date</code> object to an <code>Instant</code>.</div>
</td>
</tr>
<tr class="altColor" id="i26">
<td class="colFirst"><code><a href="../lang/String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toLocaleString()">toLocaleString</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>DateFormat.format(Date date)</code>.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i27">
<td class="colFirst"><code><a href="../lang/String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Converts this <code>Date</code> object to a <code>String</code>
of the form:
</div>
</td>
</tr>
<tr class="altColor" id="i28">
<td class="colFirst"><code>static long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#UTC(int,int,int,int,int,int)">UTC</a></span>​(int year,
int month,
int date,
int hrs,
int min,
int sec)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date, hrs, min, sec)</code>
or <code>GregorianCalendar(year + 1900, month, date, hrs, min, sec)</code>, using a UTC
<code>TimeZone</code>, followed by <code>Calendar.getTime().getTime()</code>.</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods declared in class java.lang.<a href="../lang/Object.html" title="class in java.lang">Object</a></h3>
<code><a href="../lang/Object.html#finalize()">finalize</a>, <a href="../lang/Object.html#getClass()">getClass</a>, <a href="../lang/Object.html#notify()">notify</a>, <a href="../lang/Object.html#notifyAll()">notifyAll</a>, <a href="../lang/Object.html#wait()">wait</a>, <a href="../lang/Object.html#wait(long)">wait</a>, <a href="../lang/Object.html#wait(long,int)">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="<init>()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Date</h4>
<pre>public Date()</pre>
<div class="block">Allocates a <code>Date</code> object and initializes it so that
it represents the time at which it was allocated, measured to the
nearest millisecond.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../lang/System.html#currentTimeMillis()"><code>System.currentTimeMillis()</code></a></dd>
</dl>
</li>
</ul>
<a id="<init>(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Date</h4>
<pre>public Date​(long date)</pre>
<div class="block">Allocates a <code>Date</code> object and initializes it to
represent the specified number of milliseconds since the
standard base time known as "the epoch", namely January 1,
1970, 00:00:00 GMT.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>date</code> - the milliseconds since January 1, 1970, 00:00:00 GMT.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../lang/System.html#currentTimeMillis()"><code>System.currentTimeMillis()</code></a></dd>
</dl>
</li>
</ul>
<a id="<init>(int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Date</h4>
<pre><a href="../lang/Deprecated.html" title="annotation in java.lang">@Deprecated</a>
public Date​(int year,
int month,
int date)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date)</code>
or <code>GregorianCalendar(year + 1900, month, date)</code>.</div>
</div>
<div class="block">Allocates a <code>Date</code> object and initializes it so that
it represents midnight, local time, at the beginning of the day
specified by the <code>year</code>, <code>month</code>, and
<code>date</code> arguments.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>year</code> - the year minus 1900.</dd>
<dd><code>month</code> - the month between 0-11.</dd>
<dd><code>date</code> - the day of the month between 1-31.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Calendar.html" title="class in java.util"><code>Calendar</code></a></dd>
</dl>
</li>
</ul>
<a id="<init>(int,int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Date</h4>
<pre><a href="../lang/Deprecated.html" title="annotation in java.lang">@Deprecated</a>
public Date​(int year,
int month,
int date,
int hrs,
int min)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date, hrs, min)</code>
or <code>GregorianCalendar(year + 1900, month, date, hrs, min)</code>.</div>
</div>
<div class="block">Allocates a <code>Date</code> object and initializes it so that
it represents the instant at the start of the minute specified by
the <code>year</code>, <code>month</code>, <code>date</code>,
<code>hrs</code>, and <code>min</code> arguments, in the local
time zone.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>year</code> - the year minus 1900.</dd>
<dd><code>month</code> - the month between 0-11.</dd>
<dd><code>date</code> - the day of the month between 1-31.</dd>
<dd><code>hrs</code> - the hours between 0-23.</dd>
<dd><code>min</code> - the minutes between 0-59.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Calendar.html" title="class in java.util"><code>Calendar</code></a></dd>
</dl>
</li>
</ul>
<a id="<init>(int,int,int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Date</h4>
<pre><a href="../lang/Deprecated.html" title="annotation in java.lang">@Deprecated</a>
public Date​(int year,
int month,
int date,
int hrs,
int min,
int sec)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date, hrs, min, sec)</code>
or <code>GregorianCalendar(year + 1900, month, date, hrs, min, sec)</code>.</div>
</div>
<div class="block">Allocates a <code>Date</code> object and initializes it so that
it represents the instant at the start of the second specified
by the <code>year</code>, <code>month</code>, <code>date</code>,
<code>hrs</code>, <code>min</code>, and <code>sec</code> arguments,
in the local time zone.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>year</code> - the year minus 1900.</dd>
<dd><code>month</code> - the month between 0-11.</dd>
<dd><code>date</code> - the day of the month between 1-31.</dd>
<dd><code>hrs</code> - the hours between 0-23.</dd>
<dd><code>min</code> - the minutes between 0-59.</dd>
<dd><code>sec</code> - the seconds between 0-59.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Calendar.html" title="class in java.util"><code>Calendar</code></a></dd>
</dl>
</li>
</ul>
<a id="<init>(java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Date</h4>
<pre><a href="../lang/Deprecated.html" title="annotation in java.lang">@Deprecated</a>
public Date​(<a href="../lang/String.html" title="class in java.lang">String</a> s)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>DateFormat.parse(String s)</code>.</div>
</div>
<div class="block">Allocates a <code>Date</code> object and initializes it so that
it represents the date and time indicated by the string
<code>s</code>, which is interpreted as if by the
<a href="#parse(java.lang.String)"><code>parse(java.lang.String)</code></a> method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>s</code> - a string representation of the date.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../text/DateFormat.html" title="class in java.text"><code>DateFormat</code></a>,
<a href="#parse(java.lang.String)"><code>parse(java.lang.String)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="clone()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clone</h4>
<pre class="methodSignature">public <a href="../lang/Object.html" title="class in java.lang">Object</a> clone()</pre>
<div class="block">Return a copy of this object.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../lang/Object.html#clone()">clone</a></code> in class <code><a href="../lang/Object.html" title="class in java.lang">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a clone of this instance.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../lang/Cloneable.html" title="interface in java.lang"><code>Cloneable</code></a></dd>
</dl>
</li>
</ul>
<a id="UTC(int,int,int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>UTC</h4>
<pre class="methodSignature"><a href="../lang/Deprecated.html" title="annotation in java.lang">@Deprecated</a>
public static long UTC​(int year,
int month,
int date,
int hrs,
int min,
int sec)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>Calendar.set(year + 1900, month, date, hrs, min, sec)</code>
or <code>GregorianCalendar(year + 1900, month, date, hrs, min, sec)</code>, using a UTC
<code>TimeZone</code>, followed by <code>Calendar.getTime().getTime()</code>.</div>
</div>
<div class="block">Determines the date and time based on the arguments. The
arguments are interpreted as a year, month, day of the month,
hour of the day, minute within the hour, and second within the
minute, exactly as for the <code>Date</code> constructor with six
arguments, except that the arguments are interpreted relative
to UTC rather than to the local time zone. The time indicated is
returned represented as the distance, measured in milliseconds,
of that time from the epoch (00:00:00 GMT on January 1, 1970).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>year</code> - the year minus 1900.</dd>
<dd><code>month</code> - the month between 0-11.</dd>
<dd><code>date</code> - the day of the month between 1-31.</dd>
<dd><code>hrs</code> - the hours between 0-23.</dd>
<dd><code>min</code> - the minutes between 0-59.</dd>
<dd><code>sec</code> - the seconds between 0-59.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of milliseconds since January 1, 1970, 00:00:00 GMT for
the date and time specified by the arguments.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Calendar.html" title="class in java.util"><code>Calendar</code></a></dd>
</dl>
</li>
</ul>
<a id="parse(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parse</h4>
<pre class="methodSignature"><a href="../lang/Deprecated.html" title="annotation in java.lang">@Deprecated</a>
public static long parse​(<a href="../lang/String.html" title="class in java.lang">String</a> s)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of JDK version 1.1,
replaced by <code>DateFormat.parse(String s)</code>.</div>
</div>
<div class="block">Attempts to interpret the string <code>s</code> as a representation
of a date and time. If the attempt is successful, the time
indicated is returned represented as the distance, measured in
milliseconds, of that time from the epoch (00:00:00 GMT on
January 1, 1970). If the attempt fails, an
<code>IllegalArgumentException</code> is thrown.
<p>
It accepts many syntaxes; in particular, it recognizes the IETF
standard date syntax: "Sat, 12 Aug 1995 13:30:00 GMT". It also
understands the continental U.S. time-zone abbreviations, but for
general use, a time-zone offset should be used: "Sat, 12 Aug 1995
13:30:00 GMT+0430" (4 hours, 30 minutes west of the Greenwich
meridian). If no time zone is specified, the local time zone is
assumed. GMT and UTC are considered equivalent.
<p>
The string <code>s</code> is processed from left to right, looking for
data of interest. Any material in <code>s</code> that is within the
ASCII parenthesis characters <code>(</code> and <code>)</code> is ignored.
Parentheses may be nested. Otherwise, the only characters permitted
within <code>s</code> are these ASCII characters:
<blockquote><pre>
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789,+-:/</pre></blockquote>
and whitespace characters.<p>
A consecutive sequence of decimal digits is treated as a decimal
number:<ul>
<li>If a number is preceded by <code>+</code> or <code>-</code> and a year
has already been recognized, then the number is a time-zone
offset. If the number is less than 24, it is an offset measured
in hours. Otherwise, it is regarded as an offset in minutes,
expressed in 24-hour time format without punctuation. A
preceding <code>-</code> means a westward offset. Time zone offsets
are always relative to UTC (Greenwich). Thus, for example,
<code>-5</code> occurring in the string would mean "five hours west
of Greenwich" and <code>+0430</code> would mean "four hours and
thirty minutes east of Greenwich." It is permitted for the
string to specify <code>GMT</code>, <code>UT</code>, or <code>UTC</code>
redundantly-for example, <code>GMT-5</code> or <code>utc+0430</code>.
<li>The number is regarded as a year number if one of the
following conditions is true:
<ul>
<li>The number is equal to or greater than 70 and followed by a
space, comma, slash, or end of string
<li>The number is less than 70, and both a month and a day of
the month have already been recognized</li>
</ul>
If the recognized year number is less than 100, it is
interpreted as an abbreviated year relative to a century of
which dates are within 80 years before and 19 years after
the time when the Date class is initialized.
After adjusting the year number, 1900 is subtracted from
it. For example, if the current year is 1999 then years in
the range 19 to 99 are assumed to mean 1919 to 1999, while
years from 0 to 18 are assumed to mean 2000 to 2018. Note
that this is slightly different from the interpretation of
years less than 100 that is used in <a href="../text/SimpleDateFormat.html" title="class in java.text"><code>SimpleDateFormat</code></a>.
<li>If the number is followed by a colon, it is regarded as an hour,
unless an hour has already been recognized, in which case it is
regarded as a minute.
<li>If the number is followed by a slash, it is regarded as a month
(it is decreased by 1 to produce a number in the range <code>0</code>
to <code>11</code>), unless a month has already been recognized, in
which case it is regarded as a day of the month.
<li>If the number is followed by whitespace, a comma, a hyphen, or
end of string, then if an hour has been recognized but not a
minute, it is regarded as a minute; otherwise, if a minute has
been recognized but not a second, it is regarded as a second;
otherwise, it is regarded as a day of the month. </ul><p>
A consecutive sequence of letters is regarded as a word and treated
as follows:<ul>
<li>A word that matches <code>AM</code>, ignoring case, is ignored (but
the parse fails if an hour has not been recognized or is less
than <code>1</code> or greater than <code>12</code>).
<li>A word that matches <code>PM</code>, ignoring case, adds <code>12</code>
to the hour (but the parse fails if an hour has not been
recognized or is less than <code>1</code> or greater than <code>12</code>).
<li>Any word that matches any prefix of <code>SUNDAY, MONDAY, TUESDAY,
WEDNESDAY, THURSDAY, FRIDAY</code>, or <code>SATURDAY</code>, ignoring
case, is ignored. For example, <code>sat, Friday, TUE</code>, and
<code>Thurs</code> are ignored.
<li>Otherwise, any word that matches any prefix of <code>JANUARY,
FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER,
OCTOBER, NOVEMBER</code>, or <code>DECEMBER</code>, ignoring case, and
considering them in the order given here, is recognized as
specifying a month and is converted to a number (<code>0</code> to
<code>11</code>). For example, <code>aug, Sept, april</code>, and
<code>NOV</code> are recognized as months. So is <code>Ma</code>, which
is recognized as <code>MARCH</code>, not <code>MAY</code>.
<li>Any word that matches <code>GMT, UT</code>, or <code>UTC</code>, ignoring
case, is treated as referring to UTC.
<li>Any word that matches <code>EST, CST, MST</code>, or <code>PST</code>,
ignoring case, is recognized as referring to the time zone in
North America that is five, six, seven, or eight hours west of
Greenwich, respectively. Any word that matches <code>EDT, CDT,
MDT</code>, or <code>PDT</code>, ignoring case, is recognized as
referring to the same time zone, respectively, during daylight
saving time.</ul><p>
Once the entire string s has been scanned, it is converted to a time
result in one of two ways. If a time zone or time-zone offset has been