View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0008880 | mantisbt | db postgresql | public | 2008-02-12 04:21 | 2014-05-16 15:02 |
Reporter | smig1o | Assigned To | giallu | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | LAPP | OS | Linux | OS Version | 2.6.18 |
Product Version | 1.1.1 | ||||
Fixed in Version | 1.1.2 | ||||
Summary | 0008880: Problem with date formatting in db_prepare_date function | ||||
Description | function YYYY-mm-dd If argument will be in format yyyy-mm-dd, ie: 2008-02-18 after formatting you'll get: 2008-002-18. | ||||
Steps To Reproduce | Call function db_prepare_date ( '2008-02-18' ) | ||||
Additional Information | The solution: should be replaced with | ||||
Tags | patch | ||||
Attached Files | db_prepare_date.diff (629 bytes)
Index: core/database_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/database_api.php,v retrieving revision 1.75 diff -u -r1.75 database_api.php --- core/database_api.php 28 Oct 2007 01:06:36 -0000 1.75 +++ core/database_api.php 12 Feb 2008 10:16:02 -0000 @@ -613,9 +613,7 @@ } // Format - $t_formatted = $t_a[0] . '-'; - $t_formatted .= ($t_a[1] < 10 ? "0" . $t_a[1] : $t_a[1]) . '-'; - $t_formatted .= ($t_a[2] < 10 ? "0" . $t_a[2] : $t_a[2]); + $t_formatted = sprintf('%04d-%02d-%02d', $t_a[0], $t_a[1], $t_a[2]); return $t_formatted; } | ||||
parent of | 0008878 | closed | giallu | Copy Versions scrambles Timestamp |
has duplicate | 0009044 | closed | giallu | copy Versions from root projects |
has duplicate | 0009307 | closed | giallu | Copy Version from produce incorrect timestamp |
related to | 0009651 | closed | jreese | Version copy from parent project copies incorrect date |
Actually this is all much simpler if we would just use sprintf(). Patch attached. |
|
Thanks for so quick reaction. Now let me test it ;) |
|
I think this issue should be closed then |
|
I think the patch should be checked in to CVS. Then the issue can be closed. |
|
Fixed in SVN revision 5089 |
|
MantisBT currently supports Mysql and has support for other database engines. The support for other databases is known to be problematic. Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer. If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org In the meantime, I'd advise running Mantis with Mysql Only to avoid issues. Thanks |
|
MantisBT: master-1.1.x 5cf74fea 2008-03-05 19:34 Details Diff |
Fix 8880: Problem with date formatting in db_prepare_date function This should also fix 8878 and 8792 git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/branches/BRANCH_1_1_0@5089 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9 |
Affected Issues 0008878, 0008880 |
|
mod - core/database_api.php | Diff File |