When PDF Incvoice show wrong date in Magento 2.3.5 then follow below steps.
Step 1 : Go to this path /vendor/magento/framework/Stdlib/DateTime/Timezone.php
Step 2 : Go to line no. 196 (approx).
Step 3 : Comment this below function.
1 2 3 4 5 |
public function scopeDate($scope = null, $date = null, $includeTime = false) { ... ... } |
Step 4 : Place this below mention function after above commented function.
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; } |
Step 5 : After that run below mentioned commands
1 2 |
- php bin/magento setup:upgrade - php bin/magento cache:clean |
That’s it.
After performing above steps, you can check the PDF Invoice. You will find the appropriate date in your PDF Invoices.
[crayon-63d3e47aab98e500591950/] 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.