mirror of
https://github.com/php/doc-en.git
synced 2026-03-24 07:42:10 +01:00
116 lines
3.2 KiB
XML
116 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="datetimezone.getlocation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>DateTimeZone::getLocation</refname>
|
|
<refname>timezone_location_get</refname>
|
|
<refpurpose>Returns location information for a timezone</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<para>&style.oop;</para>
|
|
<methodsynopsis role="DateTimeZone">
|
|
<modifier>public</modifier> <type class="union"><type>array</type><type>false</type></type><methodname>DateTimeZone::getLocation</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>&style.procedural;</para>
|
|
<methodsynopsis>
|
|
<type class="union"><type>array</type><type>false</type></type><methodname>timezone_location_get</methodname>
|
|
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Returns location information for a timezone, including country code, latitude/longitude and comments.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&date.datetimezone.description;
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Array containing location information about timezone&return.falseforfailure;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>DateTimeZone::getLocation</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$tz = new DateTimeZone("Asia/Jakarta");
|
|
print_r($tz->getLocation());
|
|
print_r(timezone_location_get($tz));
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[country_code] => ID
|
|
[latitude] => -6.16667
|
|
[longitude] => 106.8
|
|
[comments] => Java, Sumatra
|
|
)
|
|
Array
|
|
(
|
|
[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">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><function>DateTimeZone::listIdentifiers</function> to get a full or
|
|
partial list of all supported timezone identifiers</member>
|
|
</simplelist>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|