Skip to content

Set the timezone in the date_sun_info() example - #5740

Open
KentarouTakeda wants to merge 1 commit into
php:masterfrom
KentarouTakeda:fix-date-sun-info-timezone
Open

Set the timezone in the date_sun_info() example#5740
KentarouTakeda wants to merge 1 commit into
php:masterfrom
KentarouTakeda:fix-date-sun-info-timezone

Conversation

@KentarouTakeda

Copy link
Copy Markdown
Contributor

Split out of #5721, from the audit behind #5718.

The date_sun_info() example formatted its timestamps with date(), so the times it printed depended on whatever timezone the reader had configured. The coordinates are in Jerusalem, and the example now sets that zone.

Press Run code here and the output that appears is what this PR puts in the <screen>: https://www.php.net/manual/en/function.date-sun-info.php

The example formats timestamps with date(), so its output followed the
timezone of whoever ran it and could not be pinned down: the recorded
values match no timezone on any PHP version I could test. The
coordinates are Jerusalem, so the times are reported in that zone, as
the polar night example below already does for Prudhoe Bay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant