php-doc-en/reference/datetime/functions/time.xml

67 lines
1.7 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.time">
<refnamediv>
<refname>time</refname>
<refpurpose>Return current Unix timestamp</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<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>
<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; 60secs
echo 'Now: '. date('Y-m-d') ."\n";
echo 'Next Week: '. date('Y-m-d', $nextWeek) ."\n";
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Now: 2005-03-30
Next Week: 2005-04-07
]]>
</screen>
</example>
</para>
<para>
See also <function>date</function> and <function>microtime</function>.
</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
-->