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

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332615 c90b9560-bf6c-de11-be94-00142212c4b1
127 lines
3.5 KiB
XML
127 lines
3.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
|
||
<refentry xml:id="intlcalendar.settime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
<refnamediv>
|
||
<refname>IntlCalendar::setTime</refname>
|
||
<refpurpose>Set the calendar time in milliseconds since the epoch</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<para>
|
||
&style.oop;
|
||
</para>
|
||
<methodsynopsis>
|
||
<modifier>public</modifier> <type>bool</type><methodname>IntlCalendar::setTime</methodname>
|
||
<methodparam><type>float</type><parameter>date</parameter></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
&style.procedural;
|
||
</para>
|
||
<methodsynopsis>
|
||
<type>bool</type><methodname>intlcal_set_time</methodname>
|
||
<methodparam><type>IntlCalendar</type><parameter>cal</parameter></methodparam>
|
||
<methodparam><type>float</type><parameter>date</parameter></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Sets the instant represented by this object. The instant is represented by
|
||
a <type>float</type> whose value should be an integer number of
|
||
milliseconds since the epoch (1 Jan 1970 00:00:00.000 UTC), ignoring leap
|
||
seconds. All the field values will be recalculated accordingly.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>cal</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
The IntlCalendar resource.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>date</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
An instant represented by the number of number of milliseconds between
|
||
such instant and the epoch, ignoring leap seconds.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
Returns &true; on success and &false; on failure.
|
||
</para>
|
||
</refsect1>
|
||
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title><function>IntlCalendar::setTime</function></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
ini_set('date.timezone', 'Europe/Lisbon');
|
||
ini_set('intl.default_locale', 'fr_FR');
|
||
|
||
$cal = new IntlGregorianCalendar(2013, 5 /* May */, 1, 12, 0, 0);
|
||
|
||
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
|
||
|
||
/* In Europe/Lisbon, on 2013-10-27 at 0200, the clock goes back one hour and
|
||
the timezone from UTC+01 to UTC+00 */
|
||
|
||
$cal->setTime(strtotime('2013-10-27 00:30:00 UTC') * 1000.);
|
||
|
||
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
|
||
|
||
$cal->setTime(strtotime('2013-10-27 01:30:00 UTC') * 1000.);
|
||
|
||
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
|
||
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs;
|
||
<screen>
|
||
<![CDATA[
|
||
samedi 1 juin 2013 12:00:00 heure avancée d’Europe de l’Ouest
|
||
dimanche 27 octobre 2013 01:30:00 heure avancée d’Europe de l’Ouest
|
||
dimanche 27 octobre 2013 01:30:00 heure normale d’Europe de l’Ouest
|
||
]]>
|
||
</screen>
|
||
</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:"~/.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
|
||
-->
|