mirror of
https://github.com/php/doc-es.git
synced 2026-04-27 00:58:15 +02:00
f2aafed2e3
* XML schema correction: fix inline tag types in reference/ Replace incorrect inline markup tags to match doc-en structure: - <literal> -> <constant> for PHP constants - <literal> -> <type> for PHP types - Add missing <emphasis>, <acronym>, <classname> tags - Remove extra <function> self-references in descriptions - Fix <parameter> names to match EN * Fix: remove invalid <parameter> inside <subscript> in log.xml
287 lines
8.9 KiB
XML
287 lines
8.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no Maintainer: Marqitos -->
|
|
<refentry xml:id="function.date-sunset" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>date_sunset</refname>
|
|
<refpurpose>
|
|
Devuelve la hora de puesta del sol para un día y un lugar dados
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
<warning>
|
|
<para>
|
|
Esta función está <emphasis>OBSOLETA</emphasis> a partir de PHP 8.1.0.
|
|
Depender de esta función está altamente desaconsejo. Use
|
|
<function>date_sun_info</function> en su lugar.
|
|
</para>
|
|
</warning>
|
|
</refsynopsisdiv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier role="attribute">#[\Deprecated]</modifier>
|
|
<type class="union"><type>string</type><type>int</type><type>float</type><type>false</type></type><methodname>date_sunset</methodname>
|
|
<methodparam><type>int</type><parameter>timestamp</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>returnFormat</parameter><initializer><constant>SUNFUNCS_RET_STRING</constant></initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>float</type><type>null</type></type><parameter>latitude</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>float</type><type>null</type></type><parameter>longitude</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>float</type><type>null</type></type><parameter>zenith</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>float</type><type>null</type></type><parameter>utcOffset</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
La función <function>date_sunset</function> devuelve la hora de puesta
|
|
del sol para un día (especificado como <parameter>timestamp</parameter>
|
|
Unix) y un lugar dados.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>timestamp</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El <parameter>timestamp</parameter> Unix del día para el cual se proporciona la hora de puesta del sol.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>returnFormat</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<table>
|
|
<title>Constantes para el parámetro <parameter>returnFormat</parameter></title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Constante</entry>
|
|
<entry>Descripción</entry>
|
|
<entry>Ejemplo</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>SUNFUNCS_RET_STRING</entry>
|
|
<entry>Devuelve el resultado en forma de <type>string</type></entry>
|
|
<entry>16:46</entry>
|
|
</row>
|
|
<row>
|
|
<entry>SUNFUNCS_RET_DOUBLE</entry>
|
|
<entry>Devuelve el resultado en forma de <type>float</type></entry>
|
|
<entry>16.78243132</entry>
|
|
</row>
|
|
<row>
|
|
<entry>SUNFUNCS_RET_TIMESTAMP</entry>
|
|
<entry>Devuelve el resultado en forma de <type>int</type> (timestamp)</entry>
|
|
<entry>1095034606</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>latitude</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Por omisión, es el Norte. Pase un valor negativo para el Sur.
|
|
Ver también <link linkend="ini.date.default-latitude">date.default_latitude</link>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>longitude</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Por omisión, es el Este. Pase un valor negativo para el Oeste.
|
|
Ver también <link linkend="ini.date.default-longitude">date.default_longitude</link>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>zenith</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>zenith</parameter> es el ángulo entre el
|
|
centro del sol y la línea perpendicular a la superficie de la tierra.
|
|
Por omisión
|
|
<link linkend="ini.date.sunset-zenith">date.sunset_zenith</link>
|
|
<table>
|
|
<title>Valores comunes de ángulo <parameter>zenith</parameter></title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>Ángulo</entry>
|
|
<entry>Descripción</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>90°50'</entry>
|
|
<entry>Puesta del sol: El punto donde el sol se vuelve invisible.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>96°</entry>
|
|
<entry>Crepúsculo civil: convencionalmente utilizado para significar el fin del crepúsculo.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>102°</entry>
|
|
<entry>Crepúsculo náutico: el punto de fin del horizonte siendo visible en el mar.</entry>
|
|
</row>
|
|
<row>
|
|
<entry>108°</entry>
|
|
<entry>Crepúsculo astronómico: el punto donde el sol deja de ser la fuente de toda iluminación.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>utcOffset</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Especificado en horas.
|
|
El <parameter>utcOffset</parameter> es ignorado, si
|
|
<parameter>returnFormat</parameter> es
|
|
<constant>SUNFUNCS_RET_TIMESTAMP</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve la hora de puesta del sol en el <parameter>returnFormat</parameter>
|
|
especificado&return.falseforfailure;. Una razón posible del fallo es que
|
|
el sol no se pone, lo cual ocurre dentro de los círculos
|
|
polares durante parte del año.
|
|
</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>
|
|
<row>
|
|
<entry>8.1.0</entry>
|
|
<entry>
|
|
Esta función ha sido marcada como obsoleta en favor de <function>date_sun_info</function>.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>latitude</parameter>, <parameter>longitude</parameter>,
|
|
<parameter>zenith</parameter> y <parameter>utcOffset</parameter> ahora son nullable.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo con <function>date_sunset</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
/* Calcula la hora de puesta del sol para Lisboa, Portugal
|
|
Latitud: 38.4 Norte
|
|
Longitud: 9 Oeste
|
|
Zenith ~= 90
|
|
offset:1 GMT
|
|
*/
|
|
|
|
echo date("D M d Y"). ', hora de puesta del sol : ' .date_sunset(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1);
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in script on line 10
|
|
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in script on line 10
|
|
Mon Dec 20 2004, sunset time : 18:13
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<example>
|
|
<title>Sin puesta de sol</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$solstice = strtotime('2017-12-21');
|
|
var_dump(date_sunset($solstice, SUNFUNCS_RET_STRING, 69.245833, -53.537222));
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in script on line 3
|
|
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in script on line 3
|
|
bool(false)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>date_sun_info</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
|
|
-->
|