Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 4 of 4

Thread: Date format question

  1. #1
    Dr_Evil
    Guest


    Default Date format question

    Hi,
    Does anyone know how I can change the date format of "Upcoming Products" "date Expected" date? It is currently displaying in MM/DD/YYYY but my client would like to display it like this DD/MM/YYYY (or something similar). My first thought was changing the date format in the DB, but I quickly changed my mind on this as I imagine that all the internal date processing will be upset if I do something like this. Is that correct?


    Any comments/recommendations would really be appreciated on this, as it is the last thing before the site is totally completed.

    Thanks in advance

    Dr Evil

  2. #2
    Arpit
    Guest


    Default

    In catalog/includes/languages/english.php find the following code:

    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 
    function tep_date_raw($date, $reverse = false) { 
      if ($reverse) { 
        return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4); 
      } else { 
        return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2); 
      } 
    }
    and replace it by :

    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 dd/mm/yyyy 
    // raw date is in format YYYYMMDD, or DDMMYYYY 
    function tep_date_raw($date, $reverse = false) { 
      if ($reverse) { 
        return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4); 
      } else { 
        return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2); 
      } 
    }
    And do the same for the admin side, ie. admin/includes/languages/english.php

    Hope that helps

  3. #3
    Arpit
    Guest


    Default

    and remember always create backups ...n sorry for the duplicate posting

  4. #4
    mrpda
    Guest


    Default Date format question

    Dudes, I use this code o change date format and have success on it.
    Thanks,
    But in the footer the data still apear in English and I wish to change it to Portuguese, how I can do that?

    Best Regards,

    Marcelo

Similar Threads

  1. Quick about date format
    By damnedpig in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 07-02-2004, 07:27 AM
  2. Registration error, Date format
    By marbor in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 02-04-2004, 06:21 AM
  3. How to set date in footer to another format
    By stando in forum osCmax v1.7 Discussion
    Replies: 7
    Last Post: 01-23-2004, 06:50 AM
  4. Change date format
    By don in forum osCommerce 2.2 Installation Help
    Replies: 1
    Last Post: 01-31-2003, 07:03 PM
  5. Date format
    By killermonkey in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 01-24-2003, 02:07 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •