Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date Format


Eagle75

Recommended Posts

i was wondering in anyone knows how i can change the Date format to dd/mm/yyyy instead of mm/dd/yyy ?

 

i live in Australia and we do not use mm/dd/yyyy format here.

 

Hello,

 

You can find the code in catalog/includes/languages/english.php or whichever language

There is the code for stripping the date that the customer needs to put int.

It says like 3,2 and 0,2 that you will need to change around to the oposite

like 0,2 and 3,2 in that order.

 

Regards

 

Richard

 

B)

Link to comment
Share on other sites

Here is the 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);

}

}

Link to comment
Share on other sites

Here is the 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);

  }

}

 

thx for the reply ....... i changed the date format but its is still showin me as mm/dd/yyyy? when i go to add a product it asks what date to start from but still in that format.

Link to comment
Share on other sites

thx for the reply ....... i changed the date format but its is still showin me as mm/dd/yyyy?  when i go to add a product it asks what date to start from but still in that format.

That is just text that is showing. That you can check also in the english.php file.

 

Here is the code for that

 

// text for date of birth example

define('DOB_FORMAT_STRING', 'mm/dd/yyyy');

 

Just change it to dd/mm/yyyy

 

Regards

 

Richard

Link to comment
Share on other sites

thx for the reply ....... i changed the date format but its is still showin me as mm/dd/yyyy?  when i go to add a product it asks what date to start from but still in that format.

 

 

I've got the same problem. I've switched the order that the date is built/reorganised by substr but do I have to change the define statements too? I did try that after but got no luck there either. All the text shows correctly (the labels) but it still errors when I put in a date with a first number pair (my dd) greater than 12 (it hinks its still mm).

 

Any other suggestions?

 

ChrisJ

Link to comment
Share on other sites

thx for the reply ....... i changed the date format but its is still showin me as mm/dd/yyyy?  when i go to add a product it asks what date to start from but still in that format.

 

Eagle: Sounds like the numbers in the date have got mixed somehow. If you still have european languages installed (german and spanish) they use the date format dd/mm/yy). There might be some mileage in looking to see how its done there. Thats where I'm looking at the moment. Remember the date format for the account settings is most likely different to that for the product added dates!

 

 

I've got the same problem. I've switched the order that the date is built/reorganised by substr but do I have to change the define statements too? I did try that after but got no luck there either. All the text shows correctly (the labels) but it still errors when I put in a date with a first number pair (my dd) greater than 12 (it hinks its still mm).

 

Any other suggestions?

 

ChrisJ

Link to comment
Share on other sites

hmm .. and how to set dd.mm.YYYY instead of dd/mm/YYYY ?

 

thanx

 

You could try substituting / with . in

 

// text for date of birth example

define('DOB_FORMAT_STRING', 'mm/dd/yyyy');

 

inteh file the english.php file.

 

if not try the same in the following lines

 

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');

 

HTH

 

Chris

Link to comment
Share on other sites

You could try substituting / with . in

 

// text for date of birth example

define('DOB_FORMAT_STRING', 'mm/dd/yyyy');

 

inteh file the english.php file.

 

if not try the same in the following lines

 

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');

 

HTH

 

Chris

 

 

thanx Chris .. that did the trick .. actually i was thinking about this .. but i rather asked .. how stupid me ,,, i was waitting for one day for answers instead of try this first :) .. well we learn on our own mistakes ..

 

thanx again

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...