mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 08:22:08 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@337393 c90b9560-bf6c-de11-be94-00142212c4b1
226 lines
6.4 KiB
XML
226 lines
6.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 14af302c9c0e561fa6f9cdd956268758ba9a89c5 Maintainer: andresdzphp Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.strptime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>strptime</refname>
|
|
<refpurpose>
|
|
Analiza una fecha/hora generada con <function>strftime</function>
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>strptime</methodname>
|
|
<methodparam><type>string</type><parameter>date</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>strptime</function> devuelve una matriz con la fecha
|
|
<parameter>date</parameter> analizada, o &false; si se produjo un error.
|
|
</para>
|
|
<para>
|
|
Los nombres del mes y del día de la semana y otras cadenas dependientes del lenguaje
|
|
están subordinados a la configuración regional local establecida con <function>setlocale</function> (<constant>LC_TIME</constant>).
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>date</parameter> (<type>string</type>)</term>
|
|
<listitem>
|
|
<para>
|
|
La cadena a analizar (p.ej. devuelta por <function>strftime</function>).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>format</parameter> (<type>string</type>)</term>
|
|
<listitem>
|
|
<para>
|
|
El formato usado en <parameter>date</parameter> (p.ej. el mismo
|
|
que el usado en <function>strftime</function>). Observe que algunas de las opciones de
|
|
formato disponibles en <function>strftime</function> pueden no tener ningún
|
|
efecto en <function>strptime</function>; el subconjunto exacto que está
|
|
soportado variará según el sistema operativo y a la biblioteca de C que esté
|
|
en uso.
|
|
</para>
|
|
<para>
|
|
Para más información sobre las opciones de formato, lea la
|
|
página de <function>strftime</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve una matriz &return.falseforfailure;.
|
|
</para>
|
|
|
|
<para>
|
|
<table>
|
|
<title>Los siguietens parámetros son devueltos en la matriz</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>parámetros</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry><literal>"tm_sec"</literal></entry>
|
|
<entry>Segundos después del minuto (0-61)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_min"</literal></entry>
|
|
<entry>Minutos después de la hora (0-59)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_hour"</literal></entry>
|
|
<entry>Hora desde la medianoche (0-23)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_mday"</literal></entry>
|
|
<entry>Día del mes (1-31)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_mon"</literal></entry>
|
|
<entry>Meses desde Enero (0-11)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_year"</literal></entry>
|
|
<entry>Años desde 1900</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_wday"</literal></entry>
|
|
<entry>Días desde el Domingo (0-6)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"tm_yday"</literal></entry>
|
|
<entry>Días desde el 1 de Enero (0-365)</entry>
|
|
</row>
|
|
<row>
|
|
<entry><literal>"unparsed"</literal></entry>
|
|
<entry>la parte de <parameter>date</parameter> que no fue
|
|
reconocida usando el formato <parameter>format</parameter> especificado</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>strptime</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$formato = '%d/%m/%Y %H:%M:%S';
|
|
$strf = strftime($formato);
|
|
|
|
echo "$strf\n";
|
|
|
|
print_r(strptime($strf, $formato));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
03/10/2004 15:54:19
|
|
|
|
Array
|
|
(
|
|
[tm_sec] => 19
|
|
[tm_min] => 54
|
|
[tm_hour] => 15
|
|
[tm_mday] => 3
|
|
[tm_mon] => 9
|
|
[tm_year] => 104
|
|
[tm_wday] => 0
|
|
[tm_yday] => 276
|
|
[unparsed] =>
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
¬e.no-windows;
|
|
<note>
|
|
<para>
|
|
Internamente, esta función llama a la función <literal>strptime()</literal>
|
|
proporcionada por la biblioteca C del sistema. Esta función puede presentar
|
|
diferencias notables de comportamiento en diferentes sistemas operativos. Se
|
|
recomienda el uso de <function>date_parse_from_format</function>, a la cuál no le
|
|
afectan estas cosas, en PHP 5.3.0 y posterior.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
<literal>"tm_sec"</literal> incluye segundos intercalares (actualmente hasta 2
|
|
por año). Para más información acerca de los segundos intercalares, vea el <link
|
|
xlink:href="&url.wiki.leap-seconds;">artículo de Wikipedia
|
|
sobre segundos intercalares</link>.
|
|
</para>
|
|
</note>
|
|
<note>
|
|
<para>
|
|
Antes de PHP 5.2.0, esta función podía devolver un comportamiento indefinido. En particular,
|
|
las entradas <literal>"tm_sec"</literal>, <literal>"tm_min"</literal> y <literal>"tm_hour"</literal>
|
|
devolverían valores indefinidos.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>checkdate</function></member>
|
|
<member><function>strftime</function></member>
|
|
<member><function>date_parse_from_format</function></member>
|
|
<member><function>DateTime::createFromFormat</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
|
|
-->
|