php-doc-en/reference/datetime/functions/time.xml
Peter Cowburn 9edaff269c Typofix (spacing in example comment)
--
Patch by anonymous 

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@333770 c90b9560-bf6c-de11-be94-00142212c4b1
2014-06-13 08:12:47 +00:00

90 lines
2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.time" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>time</refname>
<refpurpose>Return current Unix timestamp</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>time</methodname>
<void/>
</methodsynopsis>
<para>
Returns the current time measured in the number of seconds since
the Unix Epoch (January 1 1970 00:00:00 GMT).
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>time</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$nextWeek = time() + (7 * 24 * 60 * 60);
// 7 days; 24 hours; 60 mins; 60 secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
// or using strtotime():
echo 'Next Week: '. date('Y-m-d', strtotime('+1 week')) ."\n";
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Now: 2005-03-30
Next Week: 2005-04-06
Next Week: 2005-04-06
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<tip>
<para>
Timestamp of the start of the request is available in
<varname>$_SERVER['REQUEST_TIME']</varname> since 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:"~/.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
-->