Sharing some useful tips, solutions and notes for Geeks.

Wednesday, January 6, 2021

Showing wrong date in invoice pdf print Magento 2

 For Magento 2 - below 2.4 versions, there is an issue in the order date showing in invoice pdf print. See below:




Order date in the invoice pdf is showing wrong. This is due to a known issue in M2 and is fixed in the latest versions. For older version users, this can be fixed by going to the file path:

                        /vendor/magento/framework/Stdlib/DateTime/Timezone.php


There comment out or remove two cases as shown in the below code and add two lines in the default switch case. Once that done, redeploy and check. The issue will get fixed. 




No comments: