mirror of
https://github.com/php/doc-ja.git
synced 2026-04-26 09:28:10 +02:00
290 lines
9.0 KiB
XML
290 lines
9.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: takagi Status: ready -->
|
|
<!-- Credits: mumumu -->
|
|
<refentry xml:id="function.date-sunset" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>date_sunset</refname>
|
|
<refpurpose>
|
|
指定した日付と場所についての日の入り時刻を返す
|
|
</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
<warning>
|
|
<para>
|
|
この関数は PHP 8.1.0 で <emphasis>非推奨</emphasis> になります。
|
|
この機能に頼らないことを強く推奨します。
|
|
代わりに <function>date_sun_info</function> を使ってください。
|
|
</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>
|
|
<function>date_sunset</function> は、与えられた日付
|
|
(<parameter>timestamp</parameter> で指定する)
|
|
と場所についての日の入り時刻を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>timestamp</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
日の入り時刻を取得する日の
|
|
<parameter>timestamp</parameter>。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>returnFormat</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<table>
|
|
<title><parameter>returnFormat</parameter> 定数</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>定数</entry>
|
|
<entry>説明</entry>
|
|
<entry>例</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>SUNFUNCS_RET_STRING</entry>
|
|
<entry>結果を <type>string</type> で返します。</entry>
|
|
<entry>16:46</entry>
|
|
</row>
|
|
<row>
|
|
<entry>SUNFUNCS_RET_DOUBLE</entry>
|
|
<entry>結果を <type>float</type> で返します。</entry>
|
|
<entry>16.78243132</entry>
|
|
</row>
|
|
<row>
|
|
<entry>SUNFUNCS_RET_TIMESTAMP</entry>
|
|
<entry>結果を <type>int</type> (タイムスタンプ) で返します。</entry>
|
|
<entry>1095034606</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>latitude</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
デフォルトは北緯で、南緯は負の値で表します。
|
|
<link linkend="ini.date.default-latitude">date.default_latitude</link> も参照ください。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>longitude</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
デフォルトは東経で、西経は負の値で表します。
|
|
<link linkend="ini.date.default-longitude">date.default_longitude</link> も参照ください。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>zenith</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>zenith</parameter> は 太陽の中心と、地球の表面からの垂線の間になす角度です。
|
|
デフォルトは <link linkend="ini.date.sunset-zenith">date.sunset_zenith</link> です。
|
|
<table>
|
|
<title>一般的な <parameter>zenith</parameter> の角度</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>角度</entry>
|
|
<entry>説明</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>90°50' </entry>
|
|
<entry>日の入り: 太陽が見えなくなる点</entry>
|
|
</row>
|
|
<row>
|
|
<entry>96°</entry>
|
|
<entry>市民薄明: 夕暮れの終わりを示すのに慣習的に使われます</entry>
|
|
</row>
|
|
<row>
|
|
<entry>102°</entry>
|
|
<entry>航海薄明: 海の上で、水平線が見えなくなった点</entry>
|
|
</row>
|
|
<row>
|
|
<entry>108°</entry>
|
|
<entry>天文薄明: 太陽があらゆる明かりの光源ではなくなった点</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>utcOffset</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
時間単位で指定します。
|
|
<parameter>returnFormat</parameter> が
|
|
<constant>SUNFUNCS_RET_TIMESTAMP</constant> の場合は、
|
|
<parameter>utcOffset</parameter> は無視されます。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
日の入り時刻を、指定した <parameter>returnFormat</parameter> で返します。
|
|
&return.falseforfailure;。
|
|
失敗する潜在的な可能性があります。太陽が全く昇らない場合です。
|
|
これは一年のある時期、極圏の中にある場合に起こります。
|
|
</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>
|
|
この関数は、推奨されなくなりました。
|
|
<function>date_sun_info</function> を使って下さい。
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>latitude</parameter>, <parameter>longitude</parameter>,
|
|
<parameter>zenith</parameter>, <parameter>utcOffset</parameter> は、nullable になりました。
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>date_sunset</function> の例</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
/* ポルトガル リスボンの日の入り時刻を計算する
|
|
緯度: 北緯 38.4
|
|
経度: 西経 9
|
|
天頂 ~= 90
|
|
時差: +1 GMT
|
|
*/
|
|
|
|
echo date("D M d Y"). ', sunset time : ' .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>No sunset</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
|
|
-->
|