- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
OpenCart 2.x. How to change date format
March 10, 2015
Hello! This tutorial shows how to change date format in OpenCart 2.x.
OpenCart 2.x. How to change date format
You may want to change the date format in your store depending on what country you are selling your products in.
Let’s learn how to change the date format in your OpenCart store to the desired one.
You may find the date in some parts of your store, like Reviews section as shown in the screenshot above:
The tutorial assumes you are logged in to your FTP/hosting control panel File Manager. In our case, we will use the File Manager to perform the changes.
-
Go to /catalog/language/english/ (or another directory under “/catalog/language/” with needed language) directory and open the default.php file for editing:
-
Locate the following code in the opened file:
1$_
[
'date_format_short'
] =
'd/m/Y'
;
-
The value you need to edit is: d/m/Y , where d is the Date, m is the Month and Y – Year.
-
Just change the order to the desired one, e.g.: m/d/Y , so the Month goes first.
Save the file to apply your changes. Go to your store front-end and refresh the page to see the changes.
The date format has been successfully changed:
You may also want to change the date format in your store admin panel:
In order to do that, you should go to the same language file located in your /admin/ directory, so the full path would be: /admin/language/english/ (or another directory under “/admin/language/” with needed language).
Change the date format query the same you did for your front-end and save the file to apply your changes.
Refresh the page to see the date format is successfully changed in your admin panel:
This is the end of the tutorial, you have learnt how to change date format in OpenCart.
Feel free to check the detailed video tutorial below: