????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.191 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/date/tests/ |
Upload File : |
--TEST--
Test date_sunset() function : usage variation - Checking sunrise for consecutive days in specific timezone
--FILE--
<?php
/* Prototype : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
* Description: Returns time of sunrise for a given day and location
* Source code: ext/date/php_date.c
* Alias to functions:
*/
echo "*** Testing date_sunset() : usage variation ***\n";
//Timezones with required data for date_sunrise
$inputs = array (
//Timezone with Latitude, Longitude and GMT offset
"Pacific/Samoa" => array ("Latitude" => -14.24, "Longitude" => -170.72, "GMT" => -11),
"US/Alaska" => array ("Latitude" => 61, "Longitude" => -150 , "GMT" => -9),
"America/Chicago" => array ("Latitude" => 41.85, "Longitude" => -87.65 , "GMT" => -5),
"America/Montevideo" => array ("Latitude" => -34.88, "Longitude" => -56.18 , "GMT" => -3),
"Africa/Casablanca" => array ("Latitude" => 33.65, "Longitude" => "-7.58", "GMT" => 0),
"Europe/Moscow" => array ("Latitude" => 55.75, "Longitude" => 37.58, "GMT" => 4),
"Asia/Hong_Kong" => array ("Latitude" => 22.28, "Longitude" => 114.15 , "GMT" => 8),
"Australia/Brisbane" => array ("Latitude" => -27.46, "Longitude" => 153.2 , "GMT" => 10),
"Pacific/Wallis" => array ("Latitude" => -13.3, "Longitude" => -176.16, "GMT" => 12),
);
foreach($inputs as $timezone => $value) {
echo "\n--$timezone--\n";
date_default_timezone_set($timezone);
$time = mktime(8, 8, 8, 8, 11, 2008);
var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"] ));
$time = mktime(8, 8, 8, 8, 12, 2008);
var_dump( date_sunset($time, SUNFUNCS_RET_STRING, $value["Latitude"], $value["Longitude"], 90, $value["GMT"]) );
}
?>
===DONE===
--EXPECTF--
*** Testing date_sunset() : usage variation ***
--Pacific/Samoa--
string(5) "18:13"
string(5) "18:13"
--US/Alaska--
string(5) "21:00"
string(5) "20:57"
--America/Chicago--
string(5) "19:51"
string(5) "19:50"
--America/Montevideo--
string(5) "18:08"
string(5) "18:09"
--Africa/Casablanca--
string(5) "19:17"
string(5) "19:16"
--Europe/Moscow--
string(5) "21:09"
string(5) "21:07"
--Asia/Hong_Kong--
string(5) "18:55"
string(5) "18:54"
--Australia/Brisbane--
string(5) "17:21"
string(5) "17:21"
--Pacific/Wallis--
string(5) "17:36"
string(5) "17:36"
===DONE===