Good Afternoon,
I need to store a runners pace i.e 10 min 20 seconds.
At the moment i am storing as an INT in seconds and then displaying on a form using
<?= $form->field($model,'pace')->textInput(['value' => date('i:s', $model->pace)]) ?>
Which works fine, But on save of the form i need to convert this back to an INT i tried the below but this gives me the datetime in int not just the seconds
public function beforeValidate(){
if(!is_int($this->pace)){
$this->pace = strtotime($this->pace);
}
return parent::beforeValidate();
}
Thank you