mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00
109 lines
2.8 KiB
XML
109 lines
2.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.date-default-timezone-set" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>date_default_timezone_set</refname>
|
|
<refpurpose>
|
|
Sets the default timezone used by all date/time functions in a script
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>date_default_timezone_set</methodname>
|
|
<methodparam><type>string</type><parameter>timezoneId</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>date_default_timezone_set</function> sets the default timezone
|
|
used by all date/time functions.
|
|
</para>
|
|
<para>
|
|
Instead of using this function to set the default timezone in your script,
|
|
you can also use the INI setting <link
|
|
linkend="ini.date.timezone">date.timezone</link> to set the default
|
|
timezone.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>timezoneId</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The timezone identifier, like <literal>UTC</literal>,
|
|
<literal>Africa/Lagos</literal>, <literal>Asia/Hong_Kong</literal>, or
|
|
<literal>Europe/Lisbon</literal>. The list of valid identifiers is
|
|
available in the <xref linkend="timezones"/>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
This function returns &false; if the
|
|
<parameter>timezoneId</parameter> isn't valid, or &true;
|
|
otherwise.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Getting the default timezone</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
date_default_timezone_set('America/Los_Angeles');
|
|
|
|
$script_tz = date_default_timezone_get();
|
|
|
|
if (strcmp($script_tz, ini_get('date.timezone'))){
|
|
echo 'Script timezone differs from ini-set timezone.';
|
|
} else {
|
|
echo 'Script timezone and ini-set timezone match.';
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>date_default_timezone_get</function></member>
|
|
<member><xref linkend="timezones"/></member>
|
|
</simplelist>
|
|
</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:"~/.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
|
|
-->
|