mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
211 lines
6.0 KiB
XML
211 lines
6.0 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.getdate" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>getdate</refname>
|
|
<refpurpose>Recupera informações de data/horário</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>getdate</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>timestamp</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retorna um <type>array</type> associativo contendo a informação
|
|
da data do <parameter>timestamp</parameter>, ou o horário atual
|
|
local se <parameter>timestamp</parameter> for &null; ou omitido.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
|
|
&date.timestamp.description;
|
|
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retorna um <type>array</type> associativo de informação sobre o
|
|
<parameter>timestamp</parameter>. Os elementos do array associativo
|
|
são os seguintes:
|
|
</para>
|
|
<para>
|
|
<table>
|
|
<title>Elementos chave de retorno do array associativo</title>
|
|
<tgroup cols="3">
|
|
<thead>
|
|
<row>
|
|
<entry>Chave</entry>
|
|
<entry>Descrição</entry>
|
|
<entry>Exemplo dos valores retornados</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><literal>"seconds"</literal></entry>
|
|
<entry>Representação numérica dos segundos</entry>
|
|
<entry><literal>0</literal> a <literal>59</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"minutes"</literal></entry>
|
|
<entry>Representação numérica dos minutos</entry>
|
|
<entry><literal>0</literal> a <literal>59</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"hours"</literal></entry>
|
|
<entry>Representação numérica das horas</entry>
|
|
<entry><literal>0</literal> a <literal>23</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"mday"</literal></entry>
|
|
<entry>Representação numérica do dia do mês</entry>
|
|
<entry><literal>1</literal> a <literal>31</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"wday"</literal></entry>
|
|
<entry>Representação numérica do dia da semana</entry>
|
|
<entry><literal>0</literal> (para Sunday) a <literal>6</literal> (para Saturday)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"mon"</literal></entry>
|
|
<entry>Representação numérica de um mês</entry>
|
|
<entry><literal>1</literal> a <literal>12</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"year"</literal></entry>
|
|
<entry>Representação numérica completa do ano, 4 dígitos</entry>
|
|
<entry>Exemplos: <literal>1999</literal> ou <literal>2003</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"yday"</literal></entry>
|
|
<entry>Representação numérica do dia do ano</entry>
|
|
<entry><literal>0</literal> a <literal>365</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"weekday"</literal></entry>
|
|
<entry>Representação textual completa do dia da semana</entry>
|
|
<entry><literal>Sunday</literal> a <literal>Saturday</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"month"</literal></entry>
|
|
<entry>Representação textual completa de um mês, tal como January ou March</entry>
|
|
<entry><literal>January</literal> a <literal>December</literal></entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>0</literal></entry>
|
|
<entry>
|
|
Segundos desde a época UNIX, similar ao valor retornados pela função
|
|
<function>time</function> e utilizado pela função <function>date</function>.
|
|
</entry>
|
|
<entry>
|
|
Dependente do sistema, tipicamente <literal>-2147483648</literal> à
|
|
<literal>2147483647</literal>.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>timestamp</parameter> agora pode ser nulo.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo da função <function>getdate</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$today = getdate();
|
|
print_r($today);
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Array
|
|
(
|
|
[seconds] => 40
|
|
[minutes] => 58
|
|
[hours] => 21
|
|
[mday] => 17
|
|
[wday] => 2
|
|
[mon] => 6
|
|
[year] => 2003
|
|
[yday] => 167
|
|
[weekday] => Tuesday
|
|
[month] => June
|
|
[0] => 1055901520
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>date</function></member>
|
|
<member><function>idate</function></member>
|
|
<member><function>localtime</function></member>
|
|
<member><function>time</function></member>
|
|
<member><function>setlocale</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
|
|
-->
|