Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Date format


npn2531

Recommended Posts

Posted

On my catalog/invoice.php this, $order->info['date_purchased'], prints out as 2013-11-05 05:41:57

ie as date and time.

 

How do I change the format so it prints in a more typical fashion such as Nov 5, 2013 without the time?

 

Thanks

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Posted

Thanks. I should clarify a bit better

 

echo tep_date_short;

or

echo tep_date_long; 

gives you the current date, (yes?) What I am looking for is to change the format of the invoice date, or rather the date of the sale that's recorded in the database in orders.date_purchased. In other words I'd like the following to be in a format like month/date/year or like Oct 10, 2013

<?php echo ENTRY_DATE_PURCHASED . $order->info['date_purchased']; ?>

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Posted

echo tep_date_short($order->info['date_purchased']);

 

Code your own date formatting function based on what you see in the tep_date_short or tep_date_long functions.

Archived

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

×
×
  • Create New...