Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I change date format of 'date_purchased'?


taitaiji

Recommended Posts

Hello, hello

 

In my invoice.php the date format of the "date_purchased" returns as YYYY-MM-DD with time (Hours:Minutes:Sesconds), where I want it to be DD-MM-YYYY (preferably without time, but that is not the main issue)

 

I am use using osC 2.3. and have changed the overall date format to german, as pasted below.

It is showing up as desired in all my administrator overviews. With the exception of my invoice.php!

 

<?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2007 osCommerce
 Released under the GNU General Public License
*/
// look in your $PATH_LOCALE/locale directory for available locales..
// on RedHat6.0 I used 'en_US'
// on FreeBSD 4.0 I use 'en_US.ISO_8859-1'
// this may not work under win32 environments..
setlocale(LC_TIME, 'de_DE.ISO_8859-1');
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('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');
define('JQUERY_DATEPICKER_I18N_CODE', ''); // leave empty for en_US; see http://jqueryui.com/demos/datepicker/#localization
define('JQUERY_DATEPICKER_FORMAT', 'dd/mm/yy'); // see http://docs.jquery.com/UI/Datepicker/formatDate
////
// 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);
 }
}

 

a maybe unprofessional, yet functioning solution to my wish for invoice date was this:

 

<tr>
   <td class="main"><strong>Rechnungdsdatum: </strong>
   <?php echo ($order_query['date_purchased']); ?>
</tr>
<tr>
   <td class="main"><strong>Rechnungs-Nr.:</strong> K-3<?php echo $oID;?>  
</td>
</tr>
<tr>

 

I trust that some generous genius in this great forum might have an answer that will set an end to my daylong struggle!? Any tips are much appreciated!

 

Good night

Tai

Link to comment
Share on other sites

Thank you Lola,

 

BUT: I can't seem to make it work. Fooling around changes date formats in other places EXCEPT invoice.php.

Any other ideas out there? Could it have to do with the "query"

<?php echo ($order_query['date_purchased']); ?>

in the invoice.php?

 

Greetings

Tai

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...