Hello,
can anybody tell me, what's wrong with tis code? date_sunset() and
date_sun_info() return totally different values for the same time and
location.
<?php
$lat = 50;
$lon = 11;
echo "PHP-Version:" . phpversion() . "\n";
date_default_ti mezone_set ("CET");
$now = time();
echo "today: ". date("d.m.Y H:i:s", $now) . "\n";
$today_sunrise = date_sunrise($n ow, SUNFUNCS_RET_TI MESTAMP, $lat, $lon);
$today_sunset = date_sunset($no w, SUNFUNCS_RET_TI MESTAMP, $lat, $lon);
echo "Sunrise 1: " . date("H:i:s", $today_sunrise) . "\n";
echo "Sunset 1: " . date("H:i:s", $today_sunset) . " \n";
$sun_info = date_sun_info($ now , $lat, $lon);
echo "Sunrise 2: ". date("H:i:s", $sun_info['sunrise']) . " \n";
echo "Sunset 2: ". date("H:i:s", $sun_info['sunset']) . " \n";
?>
And the output:
PHP-Version:5.1.4
today: 14.04.2008 22:59:11
Sunrise 1: 06:23:09
Sunset 1: 20:09:01
Sunrise 2: 04:28:57
Sunset 2: 16:51:16
TIA and greetings,
Herbert
can anybody tell me, what's wrong with tis code? date_sunset() and
date_sun_info() return totally different values for the same time and
location.
<?php
$lat = 50;
$lon = 11;
echo "PHP-Version:" . phpversion() . "\n";
date_default_ti mezone_set ("CET");
$now = time();
echo "today: ". date("d.m.Y H:i:s", $now) . "\n";
$today_sunrise = date_sunrise($n ow, SUNFUNCS_RET_TI MESTAMP, $lat, $lon);
$today_sunset = date_sunset($no w, SUNFUNCS_RET_TI MESTAMP, $lat, $lon);
echo "Sunrise 1: " . date("H:i:s", $today_sunrise) . "\n";
echo "Sunset 1: " . date("H:i:s", $today_sunset) . " \n";
$sun_info = date_sun_info($ now , $lat, $lon);
echo "Sunrise 2: ". date("H:i:s", $sun_info['sunrise']) . " \n";
echo "Sunset 2: ". date("H:i:s", $sun_info['sunset']) . " \n";
?>
And the output:
PHP-Version:5.1.4
today: 14.04.2008 22:59:11
Sunrise 1: 06:23:09
Sunset 1: 20:09:01
Sunrise 2: 04:28:57
Sunset 2: 16:51:16
TIA and greetings,
Herbert
Comment