<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >getdate</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="Data e hora" HREF="ref.datetime.html"><LINK REL="PREVIOUS" TITLE="date" HREF="function.date.html"><LINK REL="NEXT" TITLE="gettimeofday" HREF="function.gettimeofday.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.date.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.gettimeofday.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.getdate" ></A >getdate</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN26483" ></A ><P > (PHP 3, PHP 4, PHP 5)</P >getdate -- Consegue informações data/hora</DIV ><DIV CLASS="refsect1" ><A NAME="AEN26486" ></A ><H2 >Description</H2 >array <B CLASS="methodname" >getdate</B > ( [int timestamp] )<BR ></BR ><P > Retorna um <A HREF="language.types.array.html" ><B CLASS="type" >array</B ></A > associativo contendo a informação da data do <CODE CLASS="parameter" >timestamp</CODE >, ou a hora corrente local se nenhum <CODE CLASS="parameter" >timestamp</CODE > é dado,como a seguintes elementos do array: </P ><P > <DIV CLASS="table" ><A NAME="AEN26499" ></A ><P ><B >Tabela 1. Elementos chave de retorno do array associativo</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><THEAD ><TR ><TH >Chave</TH ><TH >Descrição</TH ><TH >Exemplo dos valores retornados</TH ></TR ></THEAD ><TBODY ><TR ><TD ><TT CLASS="literal" >"seconds"</TT ></TD ><TD >Representação numérica dos segundos</TD ><TD ><TT CLASS="literal" >0</TT > a <TT CLASS="literal" >59</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"minutes"</TT ></TD ><TD >Representação numérica dos minutos</TD ><TD ><TT CLASS="literal" >0</TT > a <TT CLASS="literal" >59</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"hours"</TT ></TD ><TD >Representação numérica das horas</TD ><TD ><TT CLASS="literal" >0</TT > a <TT CLASS="literal" >23</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"mday"</TT ></TD ><TD >Representação numérica do dia do mês</TD ><TD ><TT CLASS="literal" >1</TT > a <TT CLASS="literal" >31</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"wday"</TT ></TD ><TD >Representação numérica do dia da semana</TD ><TD ><TT CLASS="literal" >0</TT > (para Sunday) a <TT CLASS="literal" >6</TT > (para Saturday)</TD ></TR ><TR ><TD ><TT CLASS="literal" >"mon"</TT ></TD ><TD >Representação numérica de um mês</TD ><TD ><TT CLASS="literal" >1</TT > a <TT CLASS="literal" >12</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"year"</TT ></TD ><TD >Representação numérica completa do ano, 4 digitos</TD ><TD >Exemples: <TT CLASS="literal" >1999</TT > ou <TT CLASS="literal" >2003</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"yday"</TT ></TD ><TD >Numeric representation of the day of the year</TD ><TD ><TT CLASS="literal" >0</TT > a <TT CLASS="literal" >366</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"weekday"</TT ></TD ><TD >Representação textual completa do dia da semana</TD ><TD ><TT CLASS="literal" >Sunday</TT > a <TT CLASS="literal" >Saturday</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >"month"</TT ></TD ><TD >Representação textual completa de um mês, tal como January ou March</TD ><TD ><TT CLASS="literal" >January</TT > a <TT CLASS="literal" >December</TT ></TD ></TR ><TR ><TD ><TT CLASS="literal" >0</TT ></TD ><TD >Segundos desde a época UNIX, similar aos valores retornados por by <A HREF="function.time.html" ><B CLASS="function" >time()</B ></A > e usados por <A HREF="function.date.html" ><B CLASS="function" >date()</B ></A >.</TD ><TD >System Dependent, tipicamente de <TT CLASS="literal" >-2147483648</TT > a <TT CLASS="literal" >2147483647</TT >.</TD ></TR ></TBODY ></TABLE ></DIV > </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN26588" ></A ><P ><B >Exemplo 1. <B CLASS="function" >getdate()</B > exemplo </B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br />$today </font><font color="#007700">= </font><font color="#0000BB">getdate</font><font color="#007700">(); <br /></font><font color="#0000BB">print_r</font><font color="#007700">(</font><font color="#0000BB">$today</font><font color="#007700">);<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ><P > A saída será similar a: </P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="screen" >Array ( [seconds] => 40 [minutes] => 58 [hours] => 21 [mday] => 17 [wday] => 2 [mon] => 6 [year] => 2003 [yday] => 167 [weekday] => Tuesday [month] => June [0] => 1055901520 )</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > Veja também <A HREF="function.date.html" ><B CLASS="function" >date()</B ></A >, <A HREF="function.time.html" ><B CLASS="function" >time()</B ></A >, e <A HREF="function.setlocale.html" ><B CLASS="function" >setlocale()</B ></A >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.date.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.gettimeofday.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >date</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.datetime.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >gettimeofday</TD ></TR ></TABLE ></DIV ></BODY ></HTML >