Re: QuickForm date format question

From: Date: Fri, 07 Jul 2006 18:33:01 +0000
Subject: Re: QuickForm date format question
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24594@lists.php.net to get a copy of this message
Charles Kline wrote: > I am using this: > $form->addElement('date', 'eventEndTime', 'Event End Time', > array > ('format'=>'hiA')); > > to create a time select for an event in my form. I want the minutes > to show up as 00, 01, 02, etc. but the values are not, just the > display. Is there a way to fix this? The minutes are getting passed > as 0, 1, 2, 3 That's the intended behaviour; for storing or calculating the leading 0 could make trouble. If you really need the trailing 0, just do something like $valueWithLeadingZero = sprintf('%02d', $valueFromQF);. Regards, Mark

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