[DOC-CVS] [doc-en] master: Document what the fields in the output of DateTimeZone::getLocation() mean
[email protected] (Derick Rethans)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Derick Rethans (derickr)
Date: 2025-09-24T19:12:19+01:00
Commit: https://github.com/php/doc-en/commit/c90415586ef8e226765667808874b6fd9c33ef09
Raw diff: https://github.com/php/doc-en/commit/c90415586ef8e226765667808874b6fd9c33ef09.diff
Document what the fields in the output of DateTimeZone::getLocation() mean
Changed paths:
M reference/datetime/datetimezone/getlocation.xml
Diff:
diff --git a/reference/datetime/datetimezone/getlocation.xml b/reference/datetime/datetimezone/getlocation.xml
index 446842ec7736..095e18af0db4 100644
--- a/reference/datetime/datetimezone/getlocation.xml
+++ b/reference/datetime/datetimezone/getlocation.xml
@@ -48,7 +48,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$tz = new DateTimeZone("Europe/Prague");
+$tz = new DateTimeZone("Asia/Jakarta");
print_r($tz->getLocation());
print_r(timezone_location_get($tz));
?>
@@ -59,22 +59,30 @@ print_r(timezone_location_get($tz));
<![CDATA[
Array
(
- [country_code] => CZ
- [latitude] => 50.08333
- [longitude] => 14.43333
- [comments] =>
+ [country_code] => ID
+ [latitude] => -6.16667
+ [longitude] => 106.8
+ [comments] => Java, Sumatra
)
Array
(
- [country_code] => CZ
- [latitude] => 50.08333
- [longitude] => 14.43333
- [comments] =>
+ [country_code] => ID
+ [latitude] => -6.16667
+ [longitude] => 106.8
+ [comments] => Java, Sumatra
)
]]>
</screen>
</example>
</para>
+ <para>
+ The <literal>country_code</literal> elements contains the ISO 3166-1
+ alpha-2 country code for each entry. The <literal>latitude</literal> and
+ <literal>longitude</literal> elements the coordinates of the named city
+ from the time zone identifier, and <literal>comments</literal> contain
+ (when not &false;) a hint of where in the given country this timezone
+ applies. This information is suitable to present to end-users.
+ </para>
</refsect1>
<refsect1 role="seealso">