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

Bug #445 Date does not handle DATE_FORMAT_ISO_EXTENDED correctly
Submitted: 2003-12-17 12:16 UTC
From: mike dot carter at personalmedicaladvisor dot co dot uk Assigned: pajoye
Status: Closed Package: Date
PHP Version: 4.3.4 OS: Redhat 9
Roadmaps: (Not assigned)    
Subscription  


 [2003-12-17 12:16 UTC] mike dot carter at personalmedicaladvisor dot co dot uk
Description: ------------ Passing in what looks like a valid DATE_FORMAT_ISO_EXTENDED format string causes the Date clas to fail to parse it and manipulate its values. The values returned from getXXX() methods are based on the default values set on line 172 // unknown format $this->year = 0; $this->month = 1; $this->day = 1; $this->hour = 0; $this->minute = 0; $this->second = 0; Reproduce code: --------------- $d="2003-12-17T10:27:03Z"; $dateObj = new Date(); $dateObj->setDate($d, DATE_FORMAT_ISO_EXTENDED); echo $dateObj->getMonth(); Expected result: ---------------- 12 Actual result: -------------- 1

Comments

 [2003-12-17 19:57 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!
 [2003-12-17 20:08 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!
 [2003-12-18 11:46 UTC] mike dot carter at personalmedicaladvisor dot co dot uk
Passing date string to the Date class constructor works fine. However I need to process many dates and don't (ideally) wish to keep creating a new instance of the date object per date. Hope that quick test helps get the class fixed.
 [2003-12-20 14:07 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!
 [2003-12-21 13:48 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!
 [2004-01-05 15:35 UTC] mike dot carter at personalmedicaladvisor dot co dot uk
Sorry for the delay - i have been away. The setDate() is/was(?) the method causing the problem in the first place so the suggestion from pajoye@php.net would not help. I am in the UK, so GMT. I notice a new Date class has been released so will check this soon.
 [2006-12-01 11:30 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!