Well, using this script, no exception is thrown <?php
require 'Zend/Date.php'; $expireTime = "01:30 AM"; $expireDate = "01/06/2009"; $date = new Zend_Date; $date->setDate($expireDate); ?> So maybe I'm not following you here, but it appears that stripping off the complete setTime call results in no error. But setTime() calls _time() _time() gets to line 2706 where it creates a new instance of Zend_Date and calls set($parsed['second']) which in my test is empty. Function set() calls _calculate() with that empty value, and then _calculate throws the "parameter $date must be set, null is not allowed" message. And therein lies the problem I think. Ideas? Thanks, Tim On Tue, Jan 6, 2009 at 1:42 PM, Thomas Weidner <thomas.weid...@gmx.at> wrote: > And you also receive the error when you strip of the complete setTime() > call. > The exception you mentioned is thrown in a single place... when you call > setDate(). > And on one single reason... when the given string is 'null'. > > Maybe you call this method twice in your code ? > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- From: "Tim Rupp" <caphrim...@gmail.com> > To: <fw-general@lists.zend.com> > Sent: Tuesday, January 06, 2009 8:27 PM > Subject: [fw-general] zend_date settime question > > >> Hi list, >> >> I may be going about this the wrong way, so if that's the extent of >> the problem, then I'd appreciate some pointers. Btw, I'm using ZF >> 1.7.2. >> >> I create a zend_date object, use setdate and then try to use settime, >> but get an exception message of "parameter $date must be set, null is >> not allowed". I looked into it and it appears to stem from my lack of >> specifying a number of seconds to settime. >> >> My data is the following >> >> $expireTime = "01:30 AM"; >> $expireDate = "01/06/2009"; >> >> I'm then doing this >> >> $date = new Zend_Date; >> $date->setDate($expireDate); >> $date->setTime($expireTime, 'hh:mm'); >> >> And it's choking on the setTime call. Am I just misunderstanding the >> use of setTime here? Or is this a bug in Zend_Date or ??? I also >> receive the error if I strip off the " AM" part. So specifying seconds >> are required? I can't make it default to just zero? >> >> Any help is appreciated. >> Thanks, >> Tim > >