Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a4

Bug #9414 addSeconds fails to work properly with negative numbers
Submitted: 2006-11-21 23:16 UTC
From: kpeters at monolithss dot com Assigned: firman
Status: Closed Package: Date (version 1.4.6)
PHP Version: 4.3.3 OS: SuSE Linux 9.0
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 34 - 30 = ?

 
 [2006-11-21 23:16 UTC] kpeters at monolithss dot com (Kit Peters)
Description: ------------ Adding a negative number of seconds to a date via addSeconds does not modify the date. Test script: --------------- <?php require_once 'Date.php'; $date = new Date('2006-11-21'); print "Date is now: " . $date->format("%Y-%m-%d %H:%M") . "\n"; $date->addSeconds(-1 * 86400 * 7); # subtract 1 week print "After subtracting a week's worth of seconds, date is: " . $date->format("%Y-%m-%d %H:%M") . "\n"; ?> Expected result: ---------------- Date should be decremented by the specified number of seconds Actual result: -------------- Date is unchanged.

Comments

 [2006-11-22 00:29 UTC] firman (Firman Wandayandi)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.