If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

OpenCart 2.x. How to change date format

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