1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 00:12:06 +01:00
Files
archived-doc-es/reference/datetime/functions/localtime.xml
Yago Ferrer 43134ca244 updated to the most recent version.
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@312062 c90b9560-bf6c-de11-be94-00142212c4b1
2011-06-11 18:57:17 +00:00

208 lines
5.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e84c1f221cc8ad527ec2e37e9dd50e0d85499668 Maintainer: yago Status: ready -->
<refentry xml:id="function.localtime" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>localtime</refname>
<refpurpose>Obtiene fecha y hora local</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>localtime</methodname>
<methodparam choice="opt"><type>int</type><parameter>timestamp</parameter><initializer>time()</initializer></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>is_associative</parameter><initializer>false</initializer></methodparam>
</methodsynopsis>
<para>
La función <function>localtime</function> devuelve un array
con la estructura idéntica a la devuelta por la llamada a la función
en C.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
&date.timestamp.description;
<varlistentry>
<term><parameter>is_associative</parameter></term>
<listitem>
<para>
Si está defindo como &false; o no se proporciona, el array es devuelto como un
array indexado numéricamente. Si el argumento está definido como &true;,
<function>localtime</function> devuelve un array asociativo que contiene
todos los diferentes elementos de la estructura devuelta por la llamada a la
fucnión de C localtime. Los nombres de las diferentes claves del
array asociativo son los siguientes:
</para>
<para>
<itemizedlist>
<listitem>
<simpara>
"tm_sec" - segundos, <literal>0</literal> a <literal>59</literal>
</simpara>
</listitem>
<listitem>
<simpara>
"tm_min" - minutos, <literal>0</literal> a <literal>59</literal>
</simpara>
</listitem>
<listitem>
<simpara>
"tm_hour" - horas, <literal>0</literal> a <literal>23</literal>
</simpara>
</listitem>
<listitem>
<simpara>
"tm_mday" - día del mes, <literal>1</literal> a <literal>31</literal>
</simpara>
</listitem>
<listitem>
<simpara>
"tm_mon" - mes del año, <literal>0</literal> (Ene) a <literal>11</literal> (Dic)
</simpara>
</listitem>
<listitem>
<simpara>
"tm_year" - años desde 1900
</simpara>
</listitem>
<listitem>
<simpara>
"tm_wday" - día de la semana, <literal>0</literal> (Domingo) a <literal>6</literal> (Sábado)
</simpara>
</listitem>
<listitem>
<simpara>
"tm_yday" - día del año, <literal>0</literal> to <literal>365</literal>
</simpara>
</listitem>
<listitem>
<simpara>
"tm_isdst" - ¿Está en horario de verano?
</simpara>
<simpara>
Valor positivo si es que sí, <literal>0</literal> si es que no, negativo en caso que no se sepa.
</simpara>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
&date.timezone.errors.description;
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&date.timezone.errors.changelog;
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Ejemplo de <function>localtime</function></title>
<programlisting role="php">
<![CDATA[
<?php
$localtime = localtime();
$localtime_assoc = localtime(time(), true);
print_r($localtime);
print_r($localtime_assoc);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[0] => 24
[1] => 3
[2] => 19
[3] => 3
[4] => 3
[5] => 105
[6] => 0
[7] => 92
[8] => 1
)
Array
(
[tm_sec] => 24
[tm_min] => 3
[tm_hour] => 19
[tm_mday] => 3
[tm_mon] => 3
[tm_year] => 105
[tm_wday] => 0
[tm_yday] => 92
[tm_isdst] => 1
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>getdate</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
-->