|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40213 easter_date() returns wrong timestamp if ...
Submitted: 2007-01-23 19:29 UTC Modified: 2007-03-06 19:21 UTC
Avg. Score:3.6 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:0 (0.0%)
From: oliver dot block at lycos dot de Assigned:
Status: Suspended Package: Calendar related
PHP Version: 5.2.1RC3 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-23 19:29 UTC] oliver dot block at lycos dot de
If the timezone is set to another value than the system timezone, easter_date() will return a timestamp with respect to the systems local time, not with respect to the set timezone. 
That leads to wrong results of date/time function, e.g. date() which handle the (default) timestamp that is set my php (ini_set('date.timezone', 'UTC') or date_default_timezone_set() ).

The problem occurs, if the timezone set by php is "east" of the system's timezone, if e.g. php timezone is 'UTC' and systems timezone is 'Europe/Berlin'

Reproduce code:

Expected result:
the test


should pass.

Actual result:
the test


will fail.


correct_easter_function_to_use_TimeZone (last revision 2013-09-17 12:24 UTC by pierre dot renaudet at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-24 13:54 UTC]
Basically we need to rewrite ext/calendar from scratch (to use ext/date types and utilities) and probably merge it into ext/date.
Volunteers are welcome.
 [2007-01-25 20:16 UTC] oliver dot block at lycos dot de
Let's start with the first function.:) 
You will find a diff file here:

I also created more test files

Please check everthing and decide if you want to include it.
 [2007-01-25 20:20 UTC]
404 not found..
 [2007-01-25 21:04 UTC] oliver dot block at lycos dot de
You will find the diff file here now:
 [2007-01-29 22:03 UTC] oliver dot block at lycos dot de
I modified some of the testfiles from the former archives, because of wrong test results. It happens that easter date and DST shift occur on the same day. If so, date('Y-m-d H:i:s', easter_date($year)) will return a time portion of 01:00:00 and not 00:00:00

You find the archive here:
 [2007-03-06 12:11 UTC]
Naaah, calling mktime() with call_user_function() is just a hack, not a solution.
I've said we probably need to rewrite it from scratch and merge it into ext/date to use ext/date _internal_ functions directly, not through the user API.
 [2007-03-06 19:10 UTC] oliver dot block at lycos dot de
But it saves a lot of time and work. - I've feared that it may not convince you.:)
 [2013-09-17 12:26 UTC] pierre dot renaudet at gmail dot com
I have add a Patch, to consider TimeZone.
But Maybe Move ext/Calendar into ext/date will be more ogical...
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 06:01:29 2024 UTC