osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Date format question

This is a discussion on Date format question within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi, Does anyone know how I can change the date format of "Upcoming Products" "date Expected" date? It is currently ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 08-01-2003, 06:13 PM
New Member
 
Join Date: Feb 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Dr_Evil
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 08-02-2003, 07:53 PM
Active Member
 
Join Date: May 2003
Posts: 148
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
Arpit
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 08-02-2003, 08:00 PM
Active Member
 
Join Date: May 2003
Posts: 148
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
Arpit
Default

and remember always create backups ...n sorry for the duplicate posting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 10-23-2003, 07:23 AM
mrpda's Avatar
Lurker
 
Join Date: Sep 2003
Location: Rio de Janeiro - Brasil
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mrpda
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

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
Quick about date format damnedpig osCMax v1.7 Discussion 2 07-02-2004 08:27 AM
Registration error, Date format marbor osCMax v1.7 Discussion 1 02-04-2004 06:21 AM
How to set date in footer to another format stando osCMax v1.7 Discussion 7 01-23-2004 06:50 AM
Change date format don osCommerce 2.2 Installation Help 1 01-31-2003 07:03 PM
Date format killermonkey osCommerce 2.2 Modification Help 3 01-24-2003 02:07 AM


All times are GMT -8. The time now is 06:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax