Programmatically set a datetime field I already asked a question like this (Set date field in D8).

Ok duplicate entry? NO!

Now i have also to set a time and i'm using a array.
My code looks like this. 

$field_array = [
##begin of creating node
'uid' =&gt; $new_old_uid["new_uid"],
'type' =&gt; $content_type,
'langcode' =&gt; $lang,
'status' =&gt; (!empty($import_node-&gt;status)) ? $import_node-&gt;status : 0,

#### How to create date with times?
#Every Version causes that error -&gt; Array to string conversion in ....
### Version 1
'field_event_date_start' =&gt; [[ "value"=&gt; date('Y-m-d H:i:00',$imported_date) ]],
'field_event_date_end' =&gt; [[ "value"=&gt; date('Y-m-d H:i:00',$imported_date) ]],
### Version 2
'field_event_date_start' =&gt; [ "value"=&gt; date('Y-m-d H:i:00',$imported_date) ],
'field_event_date_end' =&gt; [ "value"=&gt; date('Y-m-d H:i:00',$imported_date) ],


### How to add a url?
'field_event_url' =&gt; (!empty($import_node-&gt;field_event_url)) ? array('value'=&gt; $imported_url) : null,
];


UPDATE:
Another try for datetime field:

'field_event_date_start' =&gt; array(
    "value" =&gt; array(
        "date" =&gt; date('Y-m-d',$imported_date),
        "time" =&gt; date('H:i:00',$imported_date)
    ),
),


Now I'm getting following error:
Placeholders must have a trailing [] if they are to be expanded with an array of values.
Datetime fields in Drupal 8 are stored as strings. So you need to convert it into string.

You can use the format method, e.g.

$formatted_date = $date-&gt;format('Y-m-d H:i:s');


Refer Inserting the value from Datetime field form

You can also use T as separator,

Like:

\DateTime::format("Y-m-d\TH:i:s"); //need a escape character in front of T.

Refer Why is my Datetime field not saved?