Bug #53148 [Fbk->NoF]: date_sunrise and date_sunset show tomorrow's times for some timezones.

From: Date: Sun, 24 Jun 2018 04:22:27 +0000
Subject: Bug #53148 [Fbk->NoF]: date_sunrise and date_sunset show tomorrow's times for some timezones.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215893@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53148&edit=1 ID: 53148 Updated by: php-bugs@lists.php.net Reported by: sec at mboca dot com Summary: date_sunrise and date_sunset show tomorrow's times for some timezones. -Status: Feedback +Status: No Feedback Type: Bug Package: Date/time related Operating System: linux and windows PHP Version: 5.2.14 and 5.3.3 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2018-02-12 18:01:55] cmb@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2013-10-28 22:14:00] phpnet at stanton dot co dot nz PHP 5.3.15 Also has this issue though I don't believe it is related to the timezone being +12 or over Keeping the timezone the same I changed the longitude value from 175 to 180 in 0.25 increments and found the sunrise/set values jump to the next day at different longitudes according to the time of the year. Checking for the sunrise time on Oct 1st 2013 10:35 (NZ summer time) at longitude 177.25 gets 2013-10-01T06:45:18+13:00 but shift the longitude to 177.5 at the sunrise is reported as 2013-10-02T06:44:18+13:00 Checking for the sunrise time on Oct 31st 2013 10:35 (NZ standard time) at longitude 175.75 gets 2013-10-31T06:09:32+13:00 but shift the longitude to 176 at the sunrise is reported as 2013-11-01T06:08:32+13:00 ------------------------------------------------------------------------ [2010-10-31 10:32:15] sec at mboca dot com I figured out a workaround to this bug. you have to add -1 day to subtract one day from sunrise and sunset times. if ($offset >= 12 && strcmp(date_default_timezone_get(), "Pacific/Tarawa") != 0) { echo "+12 GMT workaround done<br>"; $sunrise = strtotime('-1 day', $sunrise); $sunset = strtotime('-1 day', $sunset); $csunrise = strtotime('-1 day', $csunrise); $csunset = strtotime('-1 day', $csunset); $nsunrise = strtotime('-1 day', $nsunrise); $nsunset = strtotime('-1 day', $nsunset); $asunrise = strtotime('-1 day', $asunrise); $asunset = strtotime('-1 day', $asunset); } I need to test on time zones that are -12 in offsets might have to do +1 day on that offset. ------------------------------------------------------------------------ [2010-10-28 06:33:38] sec at mboca dot com It happens on php 5.3.3 too. ------------------------------------------------------------------------ [2010-10-28 06:32:07] sec at mboca dot com This bug also happens on php 5.3.3 with same configure line in my post above. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=53148 -- Edit this bug report at https://bugs.php.net/bug.php?id=53148&edit=1

« previous php.bugs (#215893) next »