Shopping Cart Forum

Go Back   eShop Forums - eCommerce Help Forum for Shopping Cart Owners. > Shopping Cart Software > Zen Cart & osCommerce
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Zen Cart & osCommerce Tips, advice and help on how to use the most popular free E-commerce shopping carts available.

Reply
 
LinkBack (3) Thread Tools Display Modes
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 15-08-2007, 01:22 AM
Lawrence Lawrence is online now
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,220
Thanks: 2
Thanked 81 Times in 81 Posts
Default How to change the date format in Zen from US to UK.

This is one of the most often asked questions I receive from new UK Zenners.

First of all backup /includes/languages/english.php then open it using your editor of choice.

Near the top of the file, you will find this section of code.

PHP Code:
define('DATE_FORMAT_SHORT''%m/%d/%Y');  // this is used for strftime()
  
define('DATE_FORMAT_LONG''%A %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');
////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
  
if (!function_exists('zen_date_raw')) {
    function 
zen_date_raw($date$reverse false) {
      if (
$reverse) {
        return 
substr($date32) . substr($date02) . substr($date64);
      } else {
        return 
substr($date64) . substr($date02) . substr($date32);
      }
    }
  } 
You need to change it to this.
PHP Code:
define('DATE_FORMAT_SHORT''%d/%m/%Y');  // this is used for strftime()
  
define('DATE_FORMAT_LONG''%A %d %B, %Y'); // this is used for strftime()
  
define('DATE_FORMAT''d/m/Y'); // this is used for date()
  
define('DATE_TIME_FORMAT'DATE_FORMAT_SHORT ' %H:%M:%S');
////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
  
if (!function_exists('zen_date_raw')) {
    function 
zen_date_raw($date$reverse false) {
      if (
$reverse) {
        return 
substr($date02) . substr($date32) . substr($date64);
      } else {
        return 
substr($date64) . substr($date32) . substr($date02);
      }
    }
  } 
Further down the file around line 72, you will find this line.
PHP Code:
 define('DOB_FORMAT_STRING''mm/dd/yyyy'); 
Change it to

PHP Code:
define('DOB_FORMAT_STRING''dd/mm/yyyy'); 
You then need to backup and open /admin/includes/languages/english.php
and do the same as above, the layout of this file is slightly different but you should be able to work out where to change the code.

Both these files are well worth studying carefully to see if there's any text you need to change to suite your site, one common one is to change "lb" to "Kg", I'm sure you'll find many others such as "USD" to "GBP".
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

LinkBacks (?)
LinkBack to this Thread: http://www.eshopforums.com/f13/how-change-date-format-zen-us-uk-92/
Posted By For Type Date
Guidance needed - Page 2 - UK Business Forums - business help and advice for owners, managers and entrepreneurs of small businesses and startups This thread Refback 27-02-2008 09:30 AM
Guidance needed - Page 2 - UK Business Forums - business help and advice for owners, managers and entrepreneurs of small businesses and startups This thread Refback 26-02-2008 08:42 PM
Guidance needed - Page 2 - UK Business Forums - business help and advice for owners, managers and entrepreneurs of small businesses and startups This thread Refback 26-02-2008 08:10 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
New ISP a change for the better artyman Computers & IT 1 04-07-2008 10:58 PM
Time for a change? ise Review my Online Store 4 07-02-2008 10:53 PM
Product Date Ranges Eveslegwear Zen Cart & osCommerce 5 22-12-2007 11:38 AM
How to create an auto updating copyright date using PHP. Lawrence PHP/HTML/CSS/JavaScript and Servers 0 14-10-2007 05:49 AM
Samsung Prices Dual Format HD Disc Player Kickstartnews Computers & IT 0 20-08-2007 04:43 AM

Google

Edible Graphics, Affordable E-Commerce, Web Shops & Custom Form Scripts
Vista Print
tech news, product reviews, the latest home and business technology, the latest in digital imaging


Content Relevant URLs by vBSEO 3.0.0