mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-29 04:12:21 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@261459 c90b9560-bf6c-de11-be94-00142212c4b1
94 lines
2.3 KiB
XML
94 lines
2.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.16 $ -->
|
|
<!-- EN-Revision: 1.10 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.time" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>time</refname>
|
|
<refpurpose>Retourne le timestamp UNIX actuel</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>time</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>time</function> retourne l'heure courante, mesurée
|
|
en secondes depuis le début de l'époque UNIX, (1er
|
|
janvier 1970 00:00:00 GMT).
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>time</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$nextWeek = time() + (7 * 24 * 60 * 60);
|
|
// 7 jours; 24 heures; 60 minutes; 60secondes
|
|
echo 'Aujourd\'hui : '. date('Y-m-d') ."\n";
|
|
echo 'Semaine prochaine : '. date('Y-m-d', $nextWeek) ."\n";
|
|
// ou en utilisant strtotime():
|
|
echo 'Semaine prochaine : '. date('Y-m-d', strtotime('+1 week')) ."\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Aujourd'hui : 2005-03-30
|
|
Semaine prochaine : 2005-04-06
|
|
Semaine prochaine : 2005-04-06
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<tip>
|
|
<para>
|
|
Un timestamp représentant le début de la demande est disponible dans
|
|
la variable <varname>$_SERVER['REQUEST_TIME']</varname> depuis PHP 5.1.
|
|
</para>
|
|
</tip>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>date</function></member>
|
|
<member><function>microtime</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
|
|
--> |