Hello,
I am a newbie as far as Mantis is concerned and have encountered a strange problem. All the dates on my bugs are showing the wrong month.
If I create a bug today (12/01/2006) the date shown in the date created field is (11/01/2006).
The same is the case for all the dates in the Issue history area, etc. etc.
Strangely, the date shown on the top of the screen in the header section is correct. It shows todays date (12/01/2006)
What should I be looking for? My web server is apache on linux and the database is MSSQL on windows.
I checked the dates on my web server and database server and they appear to be correct.
I am stumped and was wondering if anyone encountered this before.
Thanks.
PS: Another interesting observation:
I checked the data in the database. It is correct. So it seems some script is rendering it differently.
Also to note is the fact that the email messages going out also carry the wrong month in the message body as in
Created: 11/01/2006
BTW: My Mantis version is 1.0.6
Incorrect date for all fields - created / modified etc.
Moderators: Developer, Contributor
Incorrect date for all fields - created / modified etc.
Last edited by preyer on 05 Dec 2006, 23:26, edited 1 time in total.
I was able to find a temporary solution. But my gut is telling me I shouldn't be doing it this way.
Anyway, if it helps someone track down the actual cause, here it is:
File : mantis/core/adodb/adodb-time.inc.php
function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false,$is_gmt=false)
......
return $is_gmt ?
@gmmktime($hr,$min,$sec,$mon,$day,$year):
@mktime($hr,$min,$sec,$mon+1,$day,$year);
......
}
NOTE the "$mon+1" in @mktime
This resolves the issue as far as the appearance of the correct month goes and also does not alter the date-time that gets captured in the database.
I tracked the code back to
File : mantis/core/adodb/adodb.inc.php
function UnixTimeStamp($v){
....
if (!preg_match(
"|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ ,-]*(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|",
($v), $rr)) return false;
....
}
The resulting $rr[2] from the preg_match seems to be the incorrect month being passed on.
Any permanent solutions? I am almost certain I should not be messing with the adodb files.
Please let me know,
Thanks.
BTW: My Mantis version is 1.0.6
Anyway, if it helps someone track down the actual cause, here it is:
File : mantis/core/adodb/adodb-time.inc.php
function adodb_mktime($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_dst=false,$is_gmt=false)
......
return $is_gmt ?
@gmmktime($hr,$min,$sec,$mon,$day,$year):
@mktime($hr,$min,$sec,$mon+1,$day,$year);
......
}
NOTE the "$mon+1" in @mktime
This resolves the issue as far as the appearance of the correct month goes and also does not alter the date-time that gets captured in the database.
I tracked the code back to
File : mantis/core/adodb/adodb.inc.php
function UnixTimeStamp($v){
....
if (!preg_match(
"|^([0-9]{4})[-/\.]?([0-9]{1,2})[-/\.]?([0-9]{1,2})[ ,-]*(([0-9]{1,2}):?([0-9]{1,2}):?([0-9\.]{1,4}))?|",
($v), $rr)) return false;
....
}
The resulting $rr[2] from the preg_match seems to be the incorrect month being passed on.
Any permanent solutions? I am almost certain I should not be messing with the adodb files.
Please let me know,
Thanks.
BTW: My Mantis version is 1.0.6