How to set a date attribute to a current date in php using symfony 3
<p>i have a problem setting a datetime attribute to the current date , if i force it to current timestamp i get a " Call to a member function format() on string" ERROR</p>

<pre><code>**here are my getter and setter with some modifications**
public function getDateajout()
{
    date_default_timezone_set('Africa/Tunis');
    $dateajout=date_default_timezone_get();
    return $this-&gt;dateajout;
}

public function setDateajout($dateajout)
{

    $this-&gt;dateajout =$dateajout;


}
</code></pre>