Set a date programmatically
Solved the issue.
In my case, after debugging the value, I guessed the right code could be:

$date = date('Y-m-d\T00:00:00', time());


And it is. I'm not sure what the date format depends on. For sure it doesn't depends on the form display format since in the I'm using the Italian one (d/m/Y).