mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 10:28:54 +00:00

- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
110 lines
3.2 KiB
XML
110 lines
3.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.4 $ -->
|
|
<refentry xml:id="function.timezone-offset-get" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>timezone_offset_get</refname>
|
|
<refpurpose>Returns the timezone offset from GMT</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>timezone_offset_get</methodname>
|
|
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
|
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>DateTimeZone::getOffset</methodname>
|
|
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns the offset to GMT for the date/time specified in the
|
|
<parameter>datetime</parameter> parameter. The GMT offset is calculated
|
|
with the timezone information contained in the DateTime object being used.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>object</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
DateTimeZone object.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>datetime</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
DateTime that contains the date/time to compute the offset from.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns time zone offset in seconds on success or &false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>timezone_offset_get</function> examples</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Create two timezone objects, one for Taipei (Taiwan) and one for
|
|
// Tokyo (Japan)
|
|
$dateTimeZoneTaipei = new DateTimeZone("Asia/Taipei");
|
|
$dateTimeZoneJapan = new DateTimeZone("Asia/Tokyo");
|
|
|
|
// Create two DateTime objects that will contain the same Unix timestamp, but
|
|
// have different timezones attached to them.
|
|
$dateTimeTaipei = new DateTime("now", $dateTimeZoneTaipei);
|
|
$dateTimeJapan = new DateTime("now", $dateTimeZoneJapan);
|
|
|
|
// Calculate the GMT offset for the date/time contained in the $dateTimeTaipei
|
|
// object, but using the timezone rules as defined for Tokyo
|
|
// ($dateTimeZoneJapan).
|
|
$timeOffset = $dateTimeZoneJapan->getOffset($dateTimeTaipei);
|
|
|
|
// Should show int(32400) (for dates after Sat Sep 8 01:00:00 1951 JST).
|
|
var_dump($timeOffset);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</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:"../../../../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
|
|
-->
|