ID:               37358
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ache at nagual dot pp dot ru
-Status:           Open
+Status:           Assigned
 Bug Type:         Date/time related
 Operating System: FreeBSD
 PHP Version:      5.1.4
-Assigned To:      
+Assigned To:      derick
 New Comment:

Interesting, as it works fine for me in Europe/Oslo. Will check it out.


Previous Comments:
------------------------------------------------------------------------

[2006-05-08 04:35:14] ache at nagual dot pp dot ru

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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37358&edit=1

Reply via email to