jeudi 4 février 2016

Carbon: error to create date , change date affect all variables

Why change all variables.

how to avoid my variables do not change its value

In my controller

public function show()
{
    $inicio = Carbon::createFromFormat('Y-m-d H:i:s',"2016-02-04 11:00:00");
    $fin = $inicio;
    $otro = $fin->addHours(1);
    return view('horas',array('inicio'=>$inicio,'otro'=>$otro,'fin'=>$fin));
}

My views:

<p><b>Inicio: </b> {{$inicio}}</p>
<p><b>Fin: </b> {{$fin}}</p>
<p><b>Otro: </b> {{$otro}}</p>

The result

enter image description here

Where is the problem?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/23Ln8Db
via IFTTT

Aucun commentaire:

Enregistrer un commentaire