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  


 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!