I created a custom module to update news and stories to magento 2 website.I have the date field in my form( main.php ).
$dateFormat = $this->_localeDate->getDateFormat(
\IntlDateFormatter::MEDIUM
);
$timeFormat = $this->_localeDate->getTimeFormat(
\IntlDateFormatter::MEDIUM
);
$fieldset->addField(
'news_date',
'date',
[
'name' => 'news_date',
'label' => __('News date'),
'title' => __('News date'),
'date_format' => $dateFormat,
//'time_format' => $timeFormat,
'required' => true,
'disabled' => $isElementDisabled
]
);
My grid file is like below.
this->addColumn(
'news_date',
[
'header' => __('News date'),
'index' => 'news_date',
'type' => 'date',
]
);
What my issue is actual saved date is not showing in grid.if i save the news for Oct 29, 2019 grid will show Oct 28, 2019. Below attached two images.
What is the issue behind this? Can anyone please help me?