Please find the Timezone.php file in the vendor directory.
vendor/magento/framework/Stdlib/DateTime/Timezone.php
you can find the scopeDate function in that file.
Replace the below code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
public function scopeDate($scope = null, $date = null, $includeTime = false) { $timezone = new \DateTimeZone( $this->_scopeConfig->getValue($this->getDefaultTimezonePath(), $this->_scopeType, $scope) ); switch (true) { case (empty($date)): $date = new \DateTime('now', $timezone); break; case ($date instanceof \DateTime): case ($date instanceof \DateTimeImmutable): $date = $date->setTimezone($timezone); break; case (!is_numeric($date)): $timeType = $includeTime ? \IntlDateFormatter::SHORT : \IntlDateFormatter::NONE; $formatter = new \IntlDateFormatter( $this->_localeResolver->getLocale(), \IntlDateFormatter::SHORT, $timeType, $timezone ); $timestamp = $formatter->parse($date); $date = $timestamp ? (new \DateTime('@' . $timestamp))->setTimezone($timezone) : new \DateTime($date, $timezone); break; case (is_numeric($date)): $date = new \DateTime('@' . $date); $date = $date->setTimezone($timezone); break; default: $date = new \DateTime($date, $timezone); break; } if (!$includeTime) { $date->setTime(0, 0, 0); } return $date; } |
with the below code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
public function scopeDate($scope = null, $date = null, $includeTime = false) { $timezone = new \DateTimeZone( $this->_scopeConfig->getValue($this->getDefaultTimezonePath(), $this->_scopeType, $scope) ); switch (true) { case (empty($date)): $date = new \DateTime('now', $timezone); break; case ($date instanceof \DateTime): case ($date instanceof \DateTimeImmutable): $date = $date->setTimezone($timezone); break; default: $date = new \DateTime(is_numeric($date) ? '@' . $date : $date); $date->setTimezone($timezone); break; } if (!$includeTime) { $date->setTime(0, 0, 0); } return $date; } |
[crayon-63e0a73853fc7457020567/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.