Problem With Date In Textfield

I want to store the current time as the default value of a textfield.

The code I have is:

<div class="row">

<? php $ model-> time = date ('H: i: s');?>

<? php echo $ form-> labelEx ($ model, 'time');?>

<? php echo $ form-> textField ($ model, 'time', array ('value' => date ('H: i: s'), 'readonly' => true));?>

<? php echo $ form-> Error ($ model, 'time');?>

</ div>

The problem is that it saves me time, however, I keep a date, for example:


what’s a problem?

Hi nkdos,

Sorry, but I couldn’t understand what your issue is. Would you please show us the relevant code in the model and the controller?

BTW, is the strange spacing in the code intentional?