mirror of
https://github.com/php/doc-pt_br.git
synced 2026-04-29 19:23:27 +02:00
105 lines
2.5 KiB
XML
105 lines
2.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: leonardolara Status: ready --><!-- CREDITS: felipe, surfmax, fabioluciano, leonardolara -->
|
|
<refentry xml:id="function.time" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>time</refname>
|
|
<refpurpose>Retorna o timestamp Unix atual</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>time</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retorna o horário atual medido como o número de segundos desde
|
|
a Época Unix (1 de janeiro de 1970 00:00:00 GMT).
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Timestamps Unix não contêm nenhuma informação sobre fuso
|
|
horário local. Recomenda-se usar a classe
|
|
<classname>DateTimeImmutable</classname> para lidar com informações de data e
|
|
horário para evitar as armadilhas que vêm com o uso exclusivo de
|
|
timestamps Unix.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna o timestamp atual.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>time</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo 'Agora: '. time();
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Agora: 1660338149
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<tip>
|
|
<para>
|
|
O timestamp do início da requisição está disponível na variável
|
|
<varname>$_SERVER['REQUEST_TIME']</varname>.
|
|
</para>
|
|
</tip>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><classname>DateTimeImmutable</classname></member>
|
|
<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
|
|
-->
|