mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-28 06:48:56 +00:00

&date.datetime.description: date_* (except date_default_timezone_*, date_create) &date.datetimezone.description: timezone_* Added examples for: reference\datetime\functions date-create.xml date-date-set.xml date-default-timezone-get.xml date-default-timezone-set.xml date-format.xml date-isodate-set.xml date-offset-get.xml date-time-set.xml date-timezone-get.xml date-timezone-set.xml Added descriptions for: reference\datetime\functions date-create.xml date-date-set.xml date-isodate-set.xml date-modify.xml date-time-set.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@268162 c90b9560-bf6c-de11-be94-00142212c4b1
138 lines
3.6 KiB
XML
138 lines
3.6 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<refentry xml:id="function.date-time-set" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>date_time_set</refname>
|
|
<refpurpose>Sets the time</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>date_time_set</methodname>
|
|
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>DateTime::setTime</methodname>
|
|
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Resets the current time of the DateTime object to a different time.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
&date.datetime.description;
|
|
<varlistentry>
|
|
<term><parameter>hour</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Hour of the time.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>minute</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Minute of the time.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>second</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Second of the time.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns &null; on success or &false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Changing the time of a DateTime object</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
date_default_timezone_set('Europe/London');
|
|
|
|
$datetime = new DateTime('2008-08-03 12:35:23');
|
|
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
|
|
|
$datetime->setTime(14, 55, 24);
|
|
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
|
|
|
// Warning: Does not increment the hour!
|
|
// This is because the hour has been set (14) - see date_modify()
|
|
$datetime->setTime($datetime->format('H'), $datetime->format('n') + 6);
|
|
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
|
|
|
// *Does* increment the day, because the day has not been set
|
|
$datetime->setTime($datetime->format('H') + 12, $datetime->format('n'));
|
|
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
2008-08-03 12:35:23
|
|
2008-08-03 14:55:24
|
|
2008-08-03 14:14:00
|
|
2008-08-04 02:08:00
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>date_date_set</function></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:"../../../../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
|
|
-->
|