Re: Formbuilder: Date

From: Date: Tue, 22 Jun 2004 10:43:06 +0000
Subject: Re: Formbuilder: Date
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13241@lists.php.net to get a copy of this message
Try adding this to your [DB_DataObject_FormBuilder] ini section: date_element_format = "Y M d"
Display part is working here. Changed the tablefield from int(11) to datetime. From year,month,day and hours everything is saved correct. Minutes and seconds get lost somewhere and alway set to zero in the Database. In ini section i set date_element_format = "d.m.Y H:i:s" Another thing: if i setup a default date in postGenerateForm, the date/time is always set to actual date, but saved correctly in database. function postGenerateForm(&$form) {
        $form->setDefaults(array(
        	'added' => array(
	        	'd'=>date ('d', time()),
	        	'm'=>date ('m', time()),
	        	'Y'=>date ('Y', time()),
	        	'H'=>date ('H', time()),
	        	'i'=>date ('i', time()),
	        	's'=>date ('s', time())));
'added' is my datetime field. Any hints? Regards, Tobias.

« previous php.pear.general (#13241) next »