Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date of Birth format


Benjjj6

Recommended Posts

Hi,

 

I tried to change the date of birth format on the create_account.php page but it doesnt seem to have worked.

 

I wanted to change it from this format: mm/dd/yyyy (the american way) to this dd/mm/yyyy

 

I went into create_account.php and changed %m/%d/%y to %d/%m/%y

 

and I even changed the example next to the box.... BUT STILL it wants the format in months, then days, then years... because if I enter a number greater than 12 for the 'dd' it doesnt accept it because it still thinks it is months.

 

There must be something simple to solve this, i dont really know anything about php, i was just using my common sense...

 

 

help please!

Link to comment
Share on other sites

go to /includes/languages.english.php

 

Find

 

// text for gender

define('MALE', 'Male');

define('FEMALE', 'Female');

define('MALE_ADDRESS', 'Mr.');

define('FEMALE_ADDRESS', 'Ms.');

 

// text for date of birth example

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

 

and then change the dd/mm/yyyyy thats all you need to do to change the date format

 

once thats do go back the the page you said you edited in your post and make sure its changed back to what ever it was so as it doesnt cause any errors of you

Link to comment
Share on other sites

go to /includes/languages.english.php

 

Find

 

// text for gender

define('MALE', 'Male');

define('FEMALE', 'Female');

define('MALE_ADDRESS', 'Mr.');

define('FEMALE_ADDRESS', 'Ms.');

 

// text for date of birth example

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

 

and then change the dd/mm/yyyyy thats all you need to do to change the date format

 

once thats do go back the the page you said you edited in your post and make sure its changed back to what ever it was so as it doesnt cause any errors of you

Link to comment
Share on other sites

hmm sorry..... that hasnt worked it still thinks the format is mm/dd/yyyy

 

heres what i think is the relevant bit of my english.php file

 

i changed what you suggested...

 

this is just a guess but... maybe it only accepts values within a certain range? maybe thats why, even though the date is in dd/mm/yyyy it is only accepting values 1-12 for dd? Is there a way to change this?

 

 

 

<?php
/*
 $Id: english.php,v 1.114 2003/07/09 18:13:39 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// look in your $PATH_LOCALE/locale directory for available locales
// or type locale -a on the server.
// Examples:
// on RedHat try 'en_US'
// on FreeBSD try 'en_US.ISO_8859-1'
// on Windows try 'en', or 'English'
@setlocale(LC_TIME, 'en_US.ISO_8859-1');

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

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
define('LANGUAGE_CURRENCY', 'USD');

// Global entries for the <html> tag
define('HTML_PARAMS','dir="LTR" lang="en"');

// charset for web pages and emails
define('CHARSET', 'iso-8859-1');

// page title
define('TITLE', 'osCommerce');

// header text in includes/header.php
define('HEADER_TITLE_CREATE_ACCOUNT', 'Create an Account');
define('HEADER_TITLE_MY_ACCOUNT', 'My Account');
define('HEADER_TITLE_CART_CONTENTS', 'Cart Contents');
define('HEADER_TITLE_CHECKOUT', 'Checkout');
define('HEADER_TITLE_TOP', 'Top');
define('HEADER_TITLE_CATALOG', 'Catalog');
define('HEADER_TITLE_LOGOFF', 'Log Off');
define('HEADER_TITLE_LOGIN', 'Log In');

// footer text in includes/footer.php
define('FOOTER_TEXT_REQUESTS_SINCE', 'requests since');

// text for gender
define('MALE', 'Male');
define('FEMALE', 'Female');
define('MALE_ADDRESS', 'Mr.');
define('FEMALE_ADDRESS', 'Ms.');

// text for date of birth example
define('DOB_FORMAT_STRING', 'dd/mm/yyyy');

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...