Use a non-localized format.
Especially when the format is fixed as with your time.
$startDate->set('06:00:00', 'HH:mm:ss');
Zend_Date::TIMES could differ from 06:00:00 based on the locale of your
system or your browser settings as you did not set any locale.
Based on the release you are using you could also do something like this:
$startDate->set(array('hour' => 6, 'minute' => 0, 'second' => 0));
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "M@" <[email protected]>
To: <[email protected]>
Sent: Tuesday, December 22, 2009 4:09 PM
Subject: [fw-general] Zend_date set() having no effect
(I apologize in advance that I am not primarily a PHP/Zend developer - and
I'm simply maintaining a Zend project here.)
Can someone tell me what might possibly make Zend_Date's set() method have
no effect? We have code that was working perfectly on an older server
that
suddenly won't work on the new server. I've tracked it down to the fact
that a couple of Zend_Date objects are not being set. Essentially, it
looks
like this:
$startDate = new Zend_Date();
$logger->debug("startDate: ".$startDate);
$startDate->set('06:00:00',Zend_Date::TIMES);
$logger->debug("updated startDate: ".$startDate);
logged output:
startDate: Dec 21, 2009 3:10:01 PM
updated startDate: Dec 21, 2009 3:10:01 PM
I've also tried using:
date_default_timezone_set('America/Toronto');
$locale = new Zend_Locale('en_US');
$startDate = new Zend_Date($locale);
in hopes that this is something related to the Locale on the machine - but
that is of no use either. If I turn on error output, I get a warning
regarding:
call_user_func() expects parameter 1 to be a valid callback
Any ideas?
Thanks,
M@
--
View this message in context:
http://n4.nabble.com/Zend-date-set-having-no-effect-tp977025p977025.html
Sent from the Zend Framework mailing list archive at Nabble.com.