|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-08 07:13 UTC] derick@php.net
[2006-08-07 20:57 UTC] jmatos at math dot ist dot utl dot pt
[2008-11-02 12:35 UTC] jani@php.net
[2008-11-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 12:00:01 2025 UTC |
Description: ------------ In php_date.c I see some (unsuccessful) effort to calculate proper offset, I mean line gmt_offset = timelib_get_current_offset(t) / 3600; but it gets only _main_ zone offset, without current summer time added. I.e. for Europe/Moscow it _always_ gets 3, but in the summer it must be 4. This code can't work in any case, because it consider 'time' argument only few lines later: timelib_unixtime2local(t, time); but at the moment timelib_get_current_offset(t) called, 'time' arg simple unused, so you can't get summer offset this way, only main one. Please fix the code to count summer time too, Reproduce code: --------------- I have following lines in my php.ini: date.default_latitude=55.75 date.default_longitude=37.61 date.timezone=Europe/Moscow and call this test script when summer time (+0400) is active: <?php echo date("r").', '.date_sunrise(time()).', '.date_sunset(time()); echo date("r").', '.date_sunrise(time(),SUNFUNCS_RET_STRING,55.75,37.61,90.583333,4).', '.date_sunset(time(),SUNFUNCS_RET_STRING,55.75,37.61,90.583333,4); ?> Expected result: ---------------- Two echo calls must produce the same sunrise/sunset results when summer Moscow time (GMT+4, specified directly in the second echo call) is active. Actual result: -------------- Sunset/sunrise time of the first echo is one hour behind (GMT+3), when script called with summer time active. date() call itself reports +0400 properly. Moreover, I consult astronomical tables, first sunrise/sunset is definitely one hour behind.