$form['dateopening'] = array(
'#type' => 'datetime',
'#title' => t('Opening Date'),
'#default_value'=> date('Y-m-d H:i:s', strtotime($dateFromDB)),
);
I want to display datetime field on my Drupal 8 form with some date loaded from db. But the front end always shows empty fields as if no data has been provided. I tried several combinations to default_value field, but none of them are showing any thing. Please help.
(If the post is a duplicate one, redirect me. I cant get what I wanted in search results)