Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help Please ( date problem)


Ema_Swartz

Recommended Posts

Anyone knows where I can change the names on months and days from english in my language?

 

Comanda #18 (Pending)

Data Comenzii: Monday 12 June, 2006

 

I change "Order" with "Comanda" and " Order date" with "Data Comenzii" but I dont know where I can change the names of the months and days in my language.I typed a search in all files of creloaded and I changed several files but without succes for my problem. :(

Thank you in avance!

Ema S.

Link to comment
Share on other sites

When I see the code i found the date is comming from a date() function so i dont think there is any way to change it , but if then i am aslo egar to know that.

 

On which page you wanted to change the date format.

Hard Work Is The Simplest Way Of Success

Link to comment
Share on other sites

I think the problem can be somewhere in this code,but still not found where the numbers are replaced with the names of months and days in english. I want to put them in romanian

 

function tep_date_short($raw_date) {

if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

 

$year = substr($raw_date, 0, 4);

$month = (int)substr($raw_date, 5, 2);

$day = (int)substr($raw_date, 8, 2);

$hour = (int)substr($raw_date, 11, 2);

$minute = (int)substr($raw_date, 14, 2);

$second = (int)substr($raw_date, 17, 2);

 

if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {

return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));

} else {

return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));

}

 

}

 

function tep_datetime_short($raw_datetime) {

if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false;

 

$year = (int)substr($raw_datetime, 0, 4);

$month = (int)substr($raw_datetime, 5, 2);

$day = (int)substr($raw_datetime, 8, 2);

$hour = (int)substr($raw_datetime, 11, 2);

$minute = (int)substr($raw_datetime, 14, 2);

$second = (int)substr($raw_datetime, 17, 2);

 

return strftime(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));

Link to comment
Share on other sites

I think the problem can be somewhere in this code,but still not found where the numbers are replaced with the names of months and days in english. I want to put them in romanian

 

function tep_date_short($raw_date) {

if ( ($raw_date == '0000-00-00 00:00:00') || ($raw_date == '') ) return false;

 

$year = substr($raw_date, 0, 4);

$month = (int)substr($raw_date, 5, 2);

$day = (int)substr($raw_date, 8, 2);

$hour = (int)substr($raw_date, 11, 2);

$minute = (int)substr($raw_date, 14, 2);

$second = (int)substr($raw_date, 17, 2);

 

if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {

return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));

} else {

return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));

}

 

}

 

function tep_datetime_short($raw_datetime) {

if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false;

 

$year = (int)substr($raw_datetime, 0, 4);

$month = (int)substr($raw_datetime, 5, 2);

$day = (int)substr($raw_datetime, 8, 2);

$hour = (int)substr($raw_datetime, 11, 2);

$minute = (int)substr($raw_datetime, 14, 2);

$second = (int)substr($raw_datetime, 17, 2);

 

return strftime(DATE_TIME_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));

 

 

in includes/languages/english.php, folloeing constyants are defined

 

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('PHP_DATE_TIME_FORMAT', 'm/d/Y H:i:s'); // this is used for date()

define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');

 

By using these constants the numbers are replaced with the names of months and days in english using

strftime() function.

Hard Work Is The Simplest Way Of Success

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...