Forums / General Questions / Changing date format from word to numbers.

Changing date format from word to numbers.

Locked

Views: 646

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
2 Aug 2010, 8:23 PM
#1
thesinner avatar

thesinner

New Zenner

Join Date:
Jun 2010
Posts:
25
Plugin Contributions:
0

Changing date format from word to numbers.

For example
Product added a 21 april 2009
t0 21/4/2009?
is there any way?

2 Aug 2010, 9:08 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,109
Plugin Contributions:
56

Re: Changing date format from word to numbers.

In each main language file (e.g. /includes/languages/english.php) there are date-related formats:

 define('DATE_FORMAT_SHORT', '%m/%d/%Y');  // this is used for strftime()
  define('DATE_FORMAT_LONG', '%d %B, %Y'); // this is used for strftime()
  define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
  define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

If you change your DATE_FORMAT_LONG format to '%m/%d/%Y' then ALL the dates of that type (including order-related ones) will be formatted the way you indicated.

If you don't want all the "long" dates to have the m/d/y format, you can use your admin's Developer ToolKit to search for the string 'Product added on' to locate the name of the constant associated with that string and then search for that string's name to locate the PHP file that's producing the "product added on" <date> text and modify that file to use the DATE_FORMAT_SHORT date formatting.