PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #6895

Error with date2Mdbstamp dates before 1970

Details

Submitted2006-02-22 18:58 UTC
Fromstacy at igniteweb dot net
StatusWont fix
PackageMDB2
PHP Version5.0.4
OSWindows
Roadmaps(Not assigned)

Comments

[2006-02-22 18:58 UTC] stacy at igniteweb dot net

Description:
------------
Not sure if this is intentional/avoidable, but I am trying to use date2mdbstamp to format a date to insert into MySQL, but if the date is before 1970 it fails, with these errors:

Warning: mktime() [function.mktime]: Windows does not support negative values for this function in c:\Program Files\PHP\PEAR\MDB2\Date.php on line 125

Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\Program Files\PHP\PEAR\MDB2\Date.php on line 141

Test script:
---------------
// converting from mm/dd/yyyy, try 12/1/1961
if (($birth != "0000-00-00") && (strstr($birth, "/"))){
$mdb2->loadModule('Date');
$pieces = explode("/", $birth);
$birth = $mdb2->date2Mdbstamp(0,0,0, $pieces[0], $pieces[1], $pieces[2]);

}

Expected result:
----------------
I want it to return "1961-12-1 00:00:00" (for example) for insertion into the database but the function returns nothing. Is it trying to use a unix function (mktime) on windows?