I wanted to change the time / date format, but didn't like the choices available on the x-cart admin. I'm a fan of a full month (e.g. January vs Jan) and no leading 0 in time (e.g. 8:12pm vs 08:12pm). I didn't want to find each instance of the date/time in the .tpl files, so I figured I'd make the change on the configuration side. I did some poking around the smarty website and found these changes that I could make to configuration.php (~line 167 in 4.13)
In configuration.php, after
PHP Code:
if ($option == "Appearance") {
$date_formats = array(
Add: "%B %e, %Y" to the list. This gives the date format January 15, 2007 as an option found in general settings/appearance in the admin side.
After:
Add: "%l:%M %p" to the list. This gives the time format 8:15pm as an option.
Here's my complete code for that section:
PHP Code:
if ($option == "Appearance") {
$date_formats = array(
"%d-%m-%Y",
"%d/%m/%Y",
"%d.%m.%Y",
"%m-%d-%Y",
"%m/%d/%Y",
"%Y-%m-%d",
"%b %e, %Y",
"%A, %B %e, %Y",
"%B %e, %Y");
$time_formats = array(
"",
"%H:%M:%S",
"%H.%M.%S",
"%I:%M:%S %p",
"%l:%M %p");
I hope that helps someone else that wants a more streamlined appearance for dates/times on their order invoices and other places!