#51053 [Com]: unixtojd unit test failure
ID: 51053
Comment by: seanius at debian dot org
Reported By: seanius at debian dot org
Status: Open
Bug Type: Calendar related
Operating System: Debian
PHP Version: 5.3.1
New Comment:
oh and fwiw i'm GMT+1 atm
Previous Comments:
------------------------------------------------------------------------
[2010-02-15 22:52:14] seanius at debian dot org
Description:
------------
i don't know if this is a rounding problem or something else. i can
reproduce the problem on multiple architectures (32/64bit and BE/LE).
Note that i also found #28249 in which it was mentioned that the times
are calculated based on noon, and can verify that subtracting a few
hours from the second timestamp seems to get the test working.
but since there's like 24 hours worth of timezones i guess any
hardcoded value in the unit tests will probably fail somewhere :) maybe
some kind of dynamic addition/subtraction could be done based on the
local timezone?
========TEST========
<?php
echo unixtojd(40000). "\n";
echo unixtojd(1000000000). "\n";
echo unixtojd(1152459009). "\n";
?>
========DONE========
========OUT========
2440588
2452162
2453926
========DONE========
========EXP========
2440588
2452161
2453926
========DONE========
========DIFF========
002+ 2452162
002- 2452161
========DONE========
Reproduce code:
---------------
ext/calendar/tests/unixtojd.phpt
Expected result:
----------------
PASS
Actual result:
--------------
FAIL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=51053&edit=1
Thread (6 messages)