I am getting date from system config using
datepicker date format is
I want to convert it in to
yy/mm/dd H:i:s and able to convert date in format:
yy/mm/dd but time is not coming.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
In PHP, you can convert date to any format by using a combination of date and strtotime function.
Please try below format to convert date:
Suppose, you have original date as
mm/dd/yy (say 21/03/10) and you want to convert it to yy/mm/dd H:i:s format (say 10/03/21 00:00:00), then try below code:
$originalDate = "21/03/10";
$newDate = date("d-m-Y H:i:s", strtotime($originalDate));