Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date Format - Australia


Guest

Recommended Posts

Posted

Finding the correct way to configure the Date Format for Australia was a real challenge. A bit of info here and a bit there scattered throughout the forums. To make matters worse, many of the links provided by helpfull forum members are now dead.

 

However, Ive managed to get it all working correctly by making the following changes.

 

 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 strftime()
define('PHP_DATE_TIME_FORMAT', 'd.m.Y H:i:s'); // 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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
 } else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
 }
}

 

These changes need to be made near the top of the following files.

 

admin/includes/languages/english.php

 

includes/languages/english.php

 

Enjoy :-)

Posted
Finding the correct way to configure the Date Format for Australia was a real challenge. A bit of info here and a bit there scattered throughout the forums. To make matters worse, many of the links provided by helpfull forum members are now dead.

 

However, Ive managed to get it all working correctly by making the following changes.

 

 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 strftime()
define('PHP_DATE_TIME_FORMAT', 'd.m.Y H:i:s'); // 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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
 } else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
 }
}

 

These changes need to be made near the top of the following files.

 

admin/includes/languages/english.php

 

includes/languages/english.php

 

Enjoy :-)

 

You could have used the UK-Based osCommerce 2.2 contribution.

Posted
You could have used the UK-Based osCommerce 2.2 contribution.

 

I have no doubt you are right, but there is no information and no UK website link on either the oscommerce website or in the forum. If you want to be really helpful to other Australian users, please supply a link to the UK website.

 

Regards

Posted
Finding the correct way to configure the Date Format for Australia was a real challenge. A bit of info here and a bit there scattered throughout the forums. To make matters worse, many of the links provided by helpfull forum members are now dead.

 

However, Ive managed to get it all working correctly by making the following changes.

 

 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 strftime()
define('PHP_DATE_TIME_FORMAT', 'd.m.Y H:i:s'); // 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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
 } else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
 }
}

 

These changes need to be made near the top of the following files.

 

admin/includes/languages/english.php

 

includes/languages/english.php

 

Enjoy :-)

 

Thanks Buddy .. I needed that .. I couldnt work it out either.

 

Works well. :thumbsup:

Posted
I have no doubt you are right, but there is no information and no UK website link on either the oscommerce website or in the forum. If you want to be really helpful to other Australian users, please supply a link to the UK website.

 

Actually, you already had the correct date format. It is in the Spanish or German version.

  • 2 months later...
  • 1 year later...
Posted
Finding the correct way to configure the Date Format for Australia was a real challenge.

 

I much appreciate your efforts!!

Posted
I have no doubt you are right, but there is no information and no UK website link on either the oscommerce website or in the forum. If you want to be really helpful to other Australian users, please supply a link to the UK website.

 

Regards

I just noticed your reply to my post. Oviously too hard to look in the contrib section (and I did say contribution), so here is the link.

http://www.oscommerce.com/community/contri...search,uk+based

  • 4 weeks later...
Posted

Thanks for posting this, much easier than comparing two different files to work out which lines are changed.

Just one thing, you probably want to take out the period (dot) after the day in the long date format - looks really strange! :)

 

Cheers,

 

Lyn

 

Finding the correct way to configure the Date Format for Australia was a real challenge. A bit of info here and a bit there scattered throughout the forums. To make matters worse, many of the links provided by helpfull forum members are now dead.

 

However, Ive managed to get it all working correctly by making the following changes.

 

 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 strftime()
define('PHP_DATE_TIME_FORMAT', 'd.m.Y H:i:s'); // 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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
 } else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
 }
}

 

These changes need to be made near the top of the following files.

 

admin/includes/languages/english.php

 

includes/languages/english.php

 

Enjoy :-)

  • 1 month later...
Posted
Finding the correct way to configure the Date Format for Australia was a real challenge. A bit of info here and a bit there scattered throughout the forums. To make matters worse, many of the links provided by helpfull forum members are now dead.

 

However, Ive managed to get it all working correctly by making the following changes.

 

 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 strftime()
define('PHP_DATE_TIME_FORMAT', 'd.m.Y H:i:s'); // 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, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
 } else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
 }
}

 

These changes need to be made near the top of the following files.

 

admin/includes/languages/english.php

 

includes/languages/english.php

 

Enjoy :-)

 

 

Thanks!!! this worked perfectly for me!

  • 5 weeks later...
Posted

thanks mate.

 

don't forget to change the MM/DD/YYYY , 05/21/1970 etc throughout the files, just to make thigs neat

 

tim

  • 4 weeks later...
  • 6 months later...
Posted
Thanks saved me heaps of time great work

 

Changed both files on 2.2rc2a and it made no difference at all??

Trying to set date for Australia.

PS I even c oppied and paste the spanish section, it too made no difference (yes I did both english.php files)

 

Can anyone help me

Archived

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

×
×
  • Create New...