X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   More Time / Date formats in configuration.php (https://forum.x-cart.com/showthread.php?t=28033)

burtsTechie 01-15-2007 08:28 AM

More Time / Date formats in configuration.php
 
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:
PHP Code:

$time_formats = array( 


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!


All times are GMT -8. The time now is 04:48 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.