How to change date format in OpenCart

How to change date format in OpenCart

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.

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

     

  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.

 

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.

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.