Got it guys. I just simply use "date('d-m-Y')" , and tadaaa...:).
On Jan 22, 1:26 pm, "unienken" <[EMAIL PROTECTED]> wrote:
> Hi guys,
> I'm a newbie in cakePHP. Currently, i try to make an output of a
> today's date so that my user doesnt need to put today's date on the
> column DATE anymore.
> I've found some way to make an output date field. i choose to use the
> fromstring function from time helper.
> To do so, i included the fromstring function on my controller and add
> 'time' as one of helpers in my var $helpers in controller.
> When i run my application, there's an error message came regarding this
> Time helpers. the error inscription is :"Undefined variabel :time in
> c:\....\add.thtml on line 12".
> What do u thing caused the error?is there any other way of "helper
> recognizing" than just include the helper on var $helpers in
> controller?.
> Here r the scripts:
> /* add.thtml*/
> <label class="leftForm">Today's Date:
> <?php echo $time->fromstring(time) ?>
> </label>
>
> /*needactioncontroller*/
>
> class NeedActionController extends AppController
>
> var $helpers= array('Html','Time')
> function fromstring($date_string)
> {
> if (is_integer($date_string) || is_numeric($date_string))
> {
> return intval($date_string);
> }
> else {
> return strtotime($date_string);
> }
> }
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---