Categories

Featured templates

OpenCart 2.x. How to change date format

Andre Flores March 10, 2015
Rating: 5.0/5. From 1 vote.
Please wait...

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:

opencart_2.x._how_to_change_date_format_1

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.

  1. Go to /catalog/language/english/ (or another directory under “/catalog/language/” with needed language) directory and open the default.php file for editing:

    opencart_2.x._how_to_change_date_format_2

  2. Locate the following code in the opened file:

    $_['date_format_short']     = 'd/m/Y';
  3. The value you need to edit is: d/m/Y , where d is the Date, m is the Month and YYear.

  4. 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:

opencart_2.x._how_to_change_date_format_3

You may also want to change the date format in your store admin panel:

opencart_2.x._how_to_change_date_format_4

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:

opencart_2.x._how_to_change_date_format_5

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:

OpenCart 2.x. How to change date format

Best OpenCart Themes
This entry was posted in OpenCart Tutorials and tagged date, format, opencart. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket