Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-30-2007, 05:07 PM
Junior Member
 
Join Date: Jul 2007
Posts: 3
Unhappy Zend_date and Zend_db

Hello, I'm having a problem with an update statement. The Zend_Date object is convert to string like this: "30 jul 2007 19:05:08". Mysql returns an error that the datetimeformat is not correct. This is true, because it supposed to be "2007-07-30 19:05:08". How can I take care that the Zend_Db converts my Zend_Date correct?

I tried a lot. I now have this:

date_default_timezone_set('Europe/Amsterdam');

Zend_Locale_Format::setOptions(array('locale' => 'nl_NL', 'format_type' => 'iso', 'fix_date' => false, 'date_format' => Zend_Date::ISO_8601 ) );


$objDate = new Zend_Date( Zend_Date::now(), Zend_Date::ISO_8601 );
$set = array ( 'EndDateTime' => $objDate );
$where = $db->quoteInto("Id = '?'", $objImportRun->GetId() );
$rows_affected = $db->update('ImportRuns',$set, $where);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-03-2007, 03:30 AM
dEF's Avatar
dEF dEF is offline
Junior Member
 
Join Date: Jun 2007
Location: Warsaw / Poland
Posts: 6
Send a message via Skype™ to dEF
Default

try this:
PHP Code:
$date = new Zend_Date();
$date_format 'YYYY-MM-dd HH:mm:ss';
$date->toString($date_format), 
__________________
http://polygon-studio.com/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:41 PM.