forked from bjmashibing/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZoneId.html
More file actions
860 lines (857 loc) · 41.3 KB
/
ZoneId.html
File metadata and controls
860 lines (857 loc) · 41.3 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
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>ZoneId (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.time.ZoneId class">
<meta name="keywords" content="SHORT_IDS">
<meta name="keywords" content="systemDefault()">
<meta name="keywords" content="getAvailableZoneIds()">
<meta name="keywords" content="of()">
<meta name="keywords" content="ofOffset()">
<meta name="keywords" content="from()">
<meta name="keywords" content="getId()">
<meta name="keywords" content="getDisplayName()">
<meta name="keywords" content="getRules()">
<meta name="keywords" content="normalized()">
<meta name="keywords" content="equals()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="toString()">
<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="ZoneId (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":9,"i2":9,"i3":10,"i4":6,"i5":6,"i6":10,"i7":10,"i8":9,"i9":9,"i10":9,"i11":9,"i12":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/ZoneId.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><a href="#field.summary">Field</a> | </li>
<li>Constr | </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>Constr | </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.time</a></div>
<h2 title="Class ZoneId" class="title">Class ZoneId</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.time.ZoneId</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></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="ZoneOffset.html" title="class in java.time">ZoneOffset</a></code></dd>
</dl>
<hr>
<pre>public abstract class <span class="typeNameLabel">ZoneId</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></pre>
<div class="block">A time-zone ID, such as <code>Europe/Paris</code>.
<p>
A <code>ZoneId</code> is used to identify the rules used to convert between
an <a href="Instant.html" title="class in java.time"><code>Instant</code></a> and a <a href="LocalDateTime.html" title="class in java.time"><code>LocalDateTime</code></a>.
There are two distinct types of ID:
<ul>
<li>Fixed offsets - a fully resolved offset from UTC/Greenwich, that uses
the same offset for all local date-times
<li>Geographical regions - an area where a specific set of rules for finding
the offset from UTC/Greenwich apply
</ul>
Most fixed offsets are represented by <a href="ZoneOffset.html" title="class in java.time"><code>ZoneOffset</code></a>.
Calling <a href="#normalized()"><code>normalized()</code></a> on any <code>ZoneId</code> will ensure that a
fixed offset ID will be represented as a <code>ZoneOffset</code>.
<p>
The actual rules, describing when and how the offset changes, are defined by <a href="zone/ZoneRules.html" title="class in java.time.zone"><code>ZoneRules</code></a>.
This class is simply an ID used to obtain the underlying rules.
This approach is taken because rules are defined by governments and change
frequently, whereas the ID is stable.
<p>
The distinction has other effects. Serializing the <code>ZoneId</code> will only send
the ID, whereas serializing the rules sends the entire data set.
Similarly, a comparison of two IDs only examines the ID, whereas
a comparison of two rules examines the entire data set.
<h3>Time-zone IDs</h3>
The ID is unique within the system.
There are three types of ID.
<p>
The simplest type of ID is that from <code>ZoneOffset</code>.
This consists of 'Z' and IDs starting with '+' or '-'.
<p>
The next type of ID are offset-style IDs with some form of prefix,
such as 'GMT+2' or 'UTC+01:00'.
The recognised prefixes are 'UTC', 'GMT' and 'UT'.
The offset is the suffix and will be normalized during creation.
These IDs can be normalized to a <code>ZoneOffset</code> using <code>normalized()</code>.
<p>
The third type of ID are region-based IDs. A region-based ID must be of
two or more characters, and not start with 'UTC', 'GMT', 'UT' '+' or '-'.
Region-based IDs are defined by configuration, see <a href="zone/ZoneRulesProvider.html" title="class in java.time.zone"><code>ZoneRulesProvider</code></a>.
The configuration focuses on providing the lookup from the ID to the
underlying <code>ZoneRules</code>.
<p>
Time-zone rules are defined by governments and change frequently.
There are a number of organizations, known here as groups, that monitor
time-zone changes and collate them.
The default group is the IANA Time Zone Database (TZDB).
Other organizations include IATA (the airline industry body) and Microsoft.
<p>
Each group defines its own format for the region ID it provides.
The TZDB group defines IDs such as 'Europe/London' or 'America/New_York'.
TZDB IDs take precedence over other groups.
<p>
It is strongly recommended that the group name is included in all IDs supplied by
groups other than TZDB to avoid conflicts. For example, IATA airline time-zone
region IDs are typically the same as the three letter airport code.
However, the airport of Utrecht has the code 'UTC', which is obviously a conflict.
The recommended format for region IDs from groups other than TZDB is 'group~region'.
Thus if IATA data were defined, Utrecht airport would be 'IATA~UTC'.
<h3>Serialization</h3>
This class can be serialized and stores the string zone ID in the external form.
The <code>ZoneOffset</code> subclass uses a dedicated format that only stores the
offset from UTC/Greenwich.
<p>
A <code>ZoneId</code> can be deserialized in a Java Runtime where the ID is unknown.
For example, if a server-side Java Runtime has been updated with a new zone ID, but
the client-side Java Runtime has not been updated. In this case, the <code>ZoneId</code>
object will exist, and can be queried using <code>getId</code>, <code>equals</code>,
<code>hashCode</code>, <code>toString</code>, <code>getDisplayName</code> and <code>normalized</code>.
However, any call to <code>getRules</code> will fail with <code>ZoneRulesException</code>.
This approach is designed to allow a <a href="ZonedDateTime.html" title="class in java.time"><code>ZonedDateTime</code></a> to be loaded and
queried, but not modified, on a Java Runtime with incomplete time-zone information.
<p>
This is a <a href="../../../java.base/java/lang/doc-files/ValueBased.html">value-based</a>
class; use of identity-sensitive operations (including reference equality
(<code>==</code>), identity hash code, or synchronization) on instances of
<code>ZoneId</code> may have unpredictable results and should be avoided.
The <code>equals</code> method should be used for comparisons.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Requirements:</span></dt>
<dd>This abstract class has two implementations, both of which are immutable and thread-safe.
One implementation models region-based IDs, the other is <code>ZoneOffset</code> modelling
offset-based IDs. This difference is visible in serialization.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.8</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../serialized-form.html#java.time.ZoneId">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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 <a href="../util/Map.html" title="interface in java.util">Map</a><<a href="../lang/String.html" title="class in java.lang">String</a>,​<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="#SHORT_IDS">SHORT_IDS</a></span></code></th>
<td class="colLast">
<div class="block">A map of zone overrides to enable the short time-zone names to be used.</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="t3" class="tableTab" onclick="show(4);">Abstract 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></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="#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">Checks if this time-zone ID is equal to another time-zone ID.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code>static <a href="ZoneId.html" title="class in java.time">ZoneId</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#from(java.time.temporal.TemporalAccessor)">from</a></span>​(<a href="temporal/TemporalAccessor.html" title="interface in java.time.temporal">TemporalAccessor</a> temporal)</code></th>
<td class="colLast">
<div class="block">Obtains an instance of <code>ZoneId</code> from a temporal object.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>static <a href="../util/Set.html" title="interface in java.util">Set</a><<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="#getAvailableZoneIds()">getAvailableZoneIds</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the set of available zone IDs.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<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="#getDisplayName(java.time.format.TextStyle,java.util.Locale)">getDisplayName</a></span>​(<a href="format/TextStyle.html" title="enum in java.time.format">TextStyle</a> style,
<a href="../util/Locale.html" title="class in java.util">Locale</a> locale)</code></th>
<td class="colLast">
<div class="block">Gets the textual representation of the zone, such as 'British Time' or
'+02:00'.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>abstract <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="#getId()">getId</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the unique time-zone ID.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>abstract <a href="zone/ZoneRules.html" title="class in java.time.zone">ZoneRules</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRules()">getRules</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the time-zone rules for this ID allowing calculations to be performed.</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="#hashCode()">hashCode</a></span>()</code></th>
<td class="colLast">
<div class="block">A hash code for this time-zone ID.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code><a href="ZoneId.html" title="class in java.time">ZoneId</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalized()">normalized</a></span>()</code></th>
<td class="colLast">
<div class="block">Normalizes the time-zone ID, returning a <code>ZoneOffset</code> where possible.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>static <a href="ZoneId.html" title="class in java.time">ZoneId</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#of(java.lang.String)">of</a></span>​(<a href="../lang/String.html" title="class in java.lang">String</a> zoneId)</code></th>
<td class="colLast">
<div class="block">Obtains an instance of <code>ZoneId</code> from an ID ensuring that the
ID is valid and available for use.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code>static <a href="ZoneId.html" title="class in java.time">ZoneId</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#of(java.lang.String,java.util.Map)">of</a></span>​(<a href="../lang/String.html" title="class in java.lang">String</a> zoneId,
<a href="../util/Map.html" title="interface in java.util">Map</a><<a href="../lang/String.html" title="class in java.lang">String</a>,​<a href="../lang/String.html" title="class in java.lang">String</a>> aliasMap)</code></th>
<td class="colLast">
<div class="block">Obtains an instance of <code>ZoneId</code> using its ID using a map
of aliases to supplement the standard zone IDs.</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>static <a href="ZoneId.html" title="class in java.time">ZoneId</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ofOffset(java.lang.String,java.time.ZoneOffset)">ofOffset</a></span>​(<a href="../lang/String.html" title="class in java.lang">String</a> prefix,
<a href="ZoneOffset.html" title="class in java.time">ZoneOffset</a> offset)</code></th>
<td class="colLast">
<div class="block">Obtains an instance of <code>ZoneId</code> wrapping an offset.</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>static <a href="ZoneId.html" title="class in java.time">ZoneId</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#systemDefault()">systemDefault</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the system default time-zone.</div>
</td>
</tr>
<tr class="altColor" id="i12">
<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">Outputs this zone as a <code>String</code>, using the ID.</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#clone()">clone</a>, <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">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="SHORT_IDS">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SHORT_IDS</h4>
<pre>public static final <a href="../util/Map.html" title="interface in java.util">Map</a><<a href="../lang/String.html" title="class in java.lang">String</a>,​<a href="../lang/String.html" title="class in java.lang">String</a>> SHORT_IDS</pre>
<div class="block">A map of zone overrides to enable the short time-zone names to be used.
<p>
Use of short zone IDs has been deprecated in <code>java.util.TimeZone</code>.
This map allows the IDs to continue to be used via the
<a href="#of(java.lang.String,java.util.Map)"><code>of(String, Map)</code></a> factory method.
<p>
This map contains a mapping of the IDs that is in line with TZDB 2005r and
later, where 'EST', 'MST' and 'HST' map to IDs which do not include daylight
savings.
<p>
This maps as follows:
<ul>
<li>EST - -05:00</li>
<li>HST - -10:00</li>
<li>MST - -07:00</li>
<li>ACT - Australia/Darwin</li>
<li>AET - Australia/Sydney</li>
<li>AGT - America/Argentina/Buenos_Aires</li>
<li>ART - Africa/Cairo</li>
<li>AST - America/Anchorage</li>
<li>BET - America/Sao_Paulo</li>
<li>BST - Asia/Dhaka</li>
<li>CAT - Africa/Harare</li>
<li>CNT - America/St_Johns</li>
<li>CST - America/Chicago</li>
<li>CTT - Asia/Shanghai</li>
<li>EAT - Africa/Addis_Ababa</li>
<li>ECT - Europe/Paris</li>
<li>IET - America/Indiana/Indianapolis</li>
<li>IST - Asia/Kolkata</li>
<li>JST - Asia/Tokyo</li>
<li>MIT - Pacific/Apia</li>
<li>NET - Asia/Yerevan</li>
<li>NST - Pacific/Auckland</li>
<li>PLT - Asia/Karachi</li>
<li>PNT - America/Phoenix</li>
<li>PRT - America/Puerto_Rico</li>
<li>PST - America/Los_Angeles</li>
<li>SST - Pacific/Guadalcanal</li>
<li>VST - Asia/Ho_Chi_Minh</li>
</ul>
The map is unmodifiable.</div>
</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="systemDefault()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>systemDefault</h4>
<pre class="methodSignature">public static <a href="ZoneId.html" title="class in java.time">ZoneId</a> systemDefault()</pre>
<div class="block">Gets the system default time-zone.
<p>
This queries <a href="../util/TimeZone.html#getDefault()"><code>TimeZone.getDefault()</code></a> to find the default time-zone
and converts it to a <code>ZoneId</code>. If the system default time-zone is changed,
then the result of this method will also change.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the zone ID, not null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DateTimeException.html" title="class in java.time">DateTimeException</a></code> - if the converted zone ID has an invalid format</dd>
<dd><code><a href="zone/ZoneRulesException.html" title="class in java.time.zone">ZoneRulesException</a></code> - if the converted zone region ID cannot be found</dd>
</dl>
</li>
</ul>
<a id="getAvailableZoneIds()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAvailableZoneIds</h4>
<pre class="methodSignature">public static <a href="../util/Set.html" title="interface in java.util">Set</a><<a href="../lang/String.html" title="class in java.lang">String</a>> getAvailableZoneIds()</pre>
<div class="block">Gets the set of available zone IDs.
<p>
This set includes the string form of all available region-based IDs.
Offset-based zone IDs are not included in the returned set.
The ID can be passed to <a href="#of(java.lang.String)"><code>of(String)</code></a> to create a <code>ZoneId</code>.
<p>
The set of zone IDs can increase over time, although in a typical application
the set of IDs is fixed. Each call to this method is thread-safe.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a modifiable copy of the set of zone IDs, not null</dd>
</dl>
</li>
</ul>
<a id="of(java.lang.String,java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre class="methodSignature">public static <a href="ZoneId.html" title="class in java.time">ZoneId</a> of​(<a href="../lang/String.html" title="class in java.lang">String</a> zoneId,
<a href="../util/Map.html" title="interface in java.util">Map</a><<a href="../lang/String.html" title="class in java.lang">String</a>,​<a href="../lang/String.html" title="class in java.lang">String</a>> aliasMap)</pre>
<div class="block">Obtains an instance of <code>ZoneId</code> using its ID using a map
of aliases to supplement the standard zone IDs.
<p>
Many users of time-zones use short abbreviations, such as PST for
'Pacific Standard Time' and PDT for 'Pacific Daylight Time'.
These abbreviations are not unique, and so cannot be used as IDs.
This method allows a map of string to time-zone to be setup and reused
within an application.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>zoneId</code> - the time-zone ID, not null</dd>
<dd><code>aliasMap</code> - a map of alias zone IDs (typically abbreviations) to real zone IDs, not null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the zone ID, not null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DateTimeException.html" title="class in java.time">DateTimeException</a></code> - if the zone ID has an invalid format</dd>
<dd><code><a href="zone/ZoneRulesException.html" title="class in java.time.zone">ZoneRulesException</a></code> - if the zone ID is a region ID that cannot be found</dd>
</dl>
</li>
</ul>
<a id="of(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre class="methodSignature">public static <a href="ZoneId.html" title="class in java.time">ZoneId</a> of​(<a href="../lang/String.html" title="class in java.lang">String</a> zoneId)</pre>
<div class="block">Obtains an instance of <code>ZoneId</code> from an ID ensuring that the
ID is valid and available for use.
<p>
This method parses the ID producing a <code>ZoneId</code> or <code>ZoneOffset</code>.
A <code>ZoneOffset</code> is returned if the ID is 'Z', or starts with '+' or '-'.
The result will always be a valid ID for which <a href="zone/ZoneRules.html" title="class in java.time.zone"><code>ZoneRules</code></a> can be obtained.
<p>
Parsing matches the zone ID step by step as follows.
<ul>
<li>If the zone ID equals 'Z', the result is <code>ZoneOffset.UTC</code>.
<li>If the zone ID consists of a single letter, the zone ID is invalid
and <code>DateTimeException</code> is thrown.
<li>If the zone ID starts with '+' or '-', the ID is parsed as a
<code>ZoneOffset</code> using <a href="ZoneOffset.html#of(java.lang.String)"><code>ZoneOffset.of(String)</code></a>.
<li>If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a <code>ZoneId</code>
with the same ID and rules equivalent to <code>ZoneOffset.UTC</code>.
<li>If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'
then the ID is a prefixed offset-based ID. The ID is split in two, with
a two or three letter prefix and a suffix starting with the sign.
The suffix is parsed as a <a href="ZoneOffset.html#of(java.lang.String)"><code>ZoneOffset</code></a>.
The result will be a <code>ZoneId</code> with the specified UTC/GMT/UT prefix
and the normalized offset ID as per <a href="ZoneOffset.html#getId()"><code>ZoneOffset.getId()</code></a>.
The rules of the returned <code>ZoneId</code> will be equivalent to the
parsed <code>ZoneOffset</code>.
<li>All other IDs are parsed as region-based zone IDs. Region IDs must
match the regular expression <code>[A-Za-z][A-Za-z0-9~/._+-]+</code>
otherwise a <code>DateTimeException</code> is thrown. If the zone ID is not
in the configured set of IDs, <code>ZoneRulesException</code> is thrown.
The detailed format of the region ID depends on the group supplying the data.
The default set of data is supplied by the IANA Time Zone Database (TZDB).
This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.
This is compatible with most IDs from <a href="../util/TimeZone.html" title="class in java.util"><code>TimeZone</code></a>.
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>zoneId</code> - the time-zone ID, not null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the zone ID, not null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DateTimeException.html" title="class in java.time">DateTimeException</a></code> - if the zone ID has an invalid format</dd>
<dd><code><a href="zone/ZoneRulesException.html" title="class in java.time.zone">ZoneRulesException</a></code> - if the zone ID is a region ID that cannot be found</dd>
</dl>
</li>
</ul>
<a id="ofOffset(java.lang.String,java.time.ZoneOffset)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ofOffset</h4>
<pre class="methodSignature">public static <a href="ZoneId.html" title="class in java.time">ZoneId</a> ofOffset​(<a href="../lang/String.html" title="class in java.lang">String</a> prefix,
<a href="ZoneOffset.html" title="class in java.time">ZoneOffset</a> offset)</pre>
<div class="block">Obtains an instance of <code>ZoneId</code> wrapping an offset.
<p>
If the prefix is "GMT", "UTC", or "UT" a <code>ZoneId</code>
with the prefix and the non-zero offset is returned.
If the prefix is empty <code>""</code> the <code>ZoneOffset</code> is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>prefix</code> - the time-zone ID, not null</dd>
<dd><code>offset</code> - the offset, not null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the zone ID, not null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../lang/IllegalArgumentException.html" title="class in java.lang">IllegalArgumentException</a></code> - if the prefix is not one of
"GMT", "UTC", or "UT", or ""</dd>
</dl>
</li>
</ul>
<a id="from(java.time.temporal.TemporalAccessor)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>from</h4>
<pre class="methodSignature">public static <a href="ZoneId.html" title="class in java.time">ZoneId</a> from​(<a href="temporal/TemporalAccessor.html" title="interface in java.time.temporal">TemporalAccessor</a> temporal)</pre>
<div class="block">Obtains an instance of <code>ZoneId</code> from a temporal object.
<p>
This obtains a zone based on the specified temporal.
A <code>TemporalAccessor</code> represents an arbitrary set of date and time information,
which this factory converts to an instance of <code>ZoneId</code>.
<p>
A <code>TemporalAccessor</code> represents some form of date and time information.
This factory converts the arbitrary temporal object to an instance of <code>ZoneId</code>.
<p>
The conversion will try to obtain the zone in a way that favours region-based
zones over offset-based zones using <a href="temporal/TemporalQueries.html#zone()"><code>TemporalQueries.zone()</code></a>.
<p>
This method matches the signature of the functional interface <a href="temporal/TemporalQuery.html" title="interface in java.time.temporal"><code>TemporalQuery</code></a>
allowing it to be used as a query via method reference, <code>ZoneId::from</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>temporal</code> - the temporal object to convert, not null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the zone ID, not null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="DateTimeException.html" title="class in java.time">DateTimeException</a></code> - if unable to convert to a <code>ZoneId</code></dd>
</dl>
</li>
</ul>
<a id="getId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre class="methodSignature">public abstract <a href="../lang/String.html" title="class in java.lang">String</a> getId()</pre>
<div class="block">Gets the unique time-zone ID.
<p>
This ID uniquely defines this object.
The format of an offset based ID is defined by <a href="ZoneOffset.html#getId()"><code>ZoneOffset.getId()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the time-zone unique ID, not null</dd>
</dl>
</li>
</ul>
<a id="getDisplayName(java.time.format.TextStyle,java.util.Locale)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDisplayName</h4>
<pre class="methodSignature">public <a href="../lang/String.html" title="class in java.lang">String</a> getDisplayName​(<a href="format/TextStyle.html" title="enum in java.time.format">TextStyle</a> style,
<a href="../util/Locale.html" title="class in java.util">Locale</a> locale)</pre>
<div class="block">Gets the textual representation of the zone, such as 'British Time' or
'+02:00'.
<p>
This returns the textual name used to identify the time-zone ID,
suitable for presentation to the user.
The parameters control the style of the returned text and the locale.
<p>
If no textual mapping is found then the <a href="#getId()"><code>full ID</code></a> is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>style</code> - the length of the text required, not null</dd>
<dd><code>locale</code> - the locale to use, not null</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the text value of the zone, not null</dd>
</dl>
</li>
</ul>
<a id="getRules()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRules</h4>
<pre class="methodSignature">public abstract <a href="zone/ZoneRules.html" title="class in java.time.zone">ZoneRules</a> getRules()</pre>
<div class="block">Gets the time-zone rules for this ID allowing calculations to be performed.
<p>
The rules provide the functionality associated with a time-zone,
such as finding the offset for a given instant or local date-time.
<p>
A time-zone can be invalid if it is deserialized in a Java Runtime which
does not have the same rules loaded as the Java Runtime that stored it.
In this case, calling this method will throw a <code>ZoneRulesException</code>.
<p>
The rules are supplied by <a href="zone/ZoneRulesProvider.html" title="class in java.time.zone"><code>ZoneRulesProvider</code></a>. An advanced provider may
support dynamic updates to the rules without restarting the Java Runtime.
If so, then the result of this method may change over time.
Each individual call will be still remain thread-safe.
<p>
<a href="ZoneOffset.html" title="class in java.time"><code>ZoneOffset</code></a> will always return a set of rules where the offset never changes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the rules, not null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="zone/ZoneRulesException.html" title="class in java.time.zone">ZoneRulesException</a></code> - if no rules are available for this ID</dd>
</dl>
</li>
</ul>
<a id="normalized()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalized</h4>
<pre class="methodSignature">public <a href="ZoneId.html" title="class in java.time">ZoneId</a> normalized()</pre>
<div class="block">Normalizes the time-zone ID, returning a <code>ZoneOffset</code> where possible.
<p>
The returns a normalized <code>ZoneId</code> that can be used in place of this ID.
The result will have <code>ZoneRules</code> equivalent to those returned by this object,
however the ID returned by <code>getId()</code> may be different.
<p>
The normalization checks if the rules of this <code>ZoneId</code> have a fixed offset.
If they do, then the <code>ZoneOffset</code> equal to that offset is returned.
Otherwise <code>this</code> is returned.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the time-zone unique ID, not null</dd>
</dl>
</li>
</ul>
<a id="equals(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre class="methodSignature">public boolean equals​(<a href="../lang/Object.html" title="class in java.lang">Object</a> obj)</pre>
<div class="block">Checks if this time-zone ID is equal to another time-zone ID.
<p>
The comparison is based on the ID.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../lang/Object.html#equals(java.lang.Object)">equals</a></code> in class <code><a href="../lang/Object.html" title="class in java.lang">Object</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>obj</code> - the object to check, null returns false</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this is equal to the other time-zone ID</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../lang/Object.html#hashCode()"><code>Object.hashCode()</code></a>,
<a href="../util/HashMap.html" title="class in java.util"><code>HashMap</code></a></dd>
</dl>
</li>
</ul>
<a id="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre class="methodSignature">public int hashCode()</pre>
<div class="block">A hash code for this time-zone ID.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../lang/Object.html#hashCode()">hashCode</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 suitable hash code</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../lang/Object.html#equals(java.lang.Object)"><code>Object.equals(java.lang.Object)</code></a>,
<a href="../lang/System.html#identityHashCode(java.lang.Object)"><code>System.identityHashCode(java.lang.Object)</code></a></dd>
</dl>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public <a href="../lang/String.html" title="class in java.lang">String</a> toString()</pre>
<div class="block">Outputs this zone as a <code>String</code>, using the ID.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../lang/Object.html#toString()">toString</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 string representation of this time-zone ID, not null</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.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/ZoneId.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><a href="#field.summary">Field</a> | </li>
<li>Constr | </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>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><a href="https://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> For further API reference and developer documentation see the <a href="https://docs.oracle.com/pls/topic/lookup?ctx=javase12.0.2&id=homepage" target="_blank">Java SE Documentation</a>, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.<br> <a href="../../../../legal/copyright.html">Copyright</a> © 1993, 2019, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.<br>All rights reserved. Use is subject to <a href="https://www.oracle.com/technetwork/java/javase/terms/license/java12.0.2speclicense.html">license terms</a> and the <a href="https://www.oracle.com/technetwork/java/redist-137594.html">documentation redistribution policy</a>. <!-- Version 12.0.2+10 --></small></p>
</footer>
</body>
</html>