teoyh
Member
I have this date element
Which i set the store Date As local time
In my listcsv import script ;
I had written this code to convert the string date to the date value
$ogiftdate = $formModel->formData['stml_gift_recipient___giftdate']; //DATE
date_default_timezone_set( 'Asia/Singapore');
$giftdate = date('Y-m-d',strtotime("$ogiftdate"));
I did a dump of the $giftdate and confirm it is correct as my csv file but the moment it get imported the day is always 1 day less the actual date in my csv file example 2021-02-03 in my csv file but actual value store is 2021-02-02
Can someone help me with this , thank you in advance
Which i set the store Date As local time
In my listcsv import script ;
I had written this code to convert the string date to the date value
$ogiftdate = $formModel->formData['stml_gift_recipient___giftdate']; //DATE
date_default_timezone_set( 'Asia/Singapore');
$giftdate = date('Y-m-d',strtotime("$ogiftdate"));
I did a dump of the $giftdate and confirm it is correct as my csv file but the moment it get imported the day is always 1 day less the actual date in my csv file example 2021-02-03 in my csv file but actual value store is 2021-02-02
Can someone help me with this , thank you in advance