npn2531 Posted November 5, 2013 Posted November 5, 2013 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
burt Posted November 5, 2013 Posted November 5, 2013 tep_date_short tep_date_long or roll your own date function...
npn2531 Posted November 5, 2013 Author Posted November 5, 2013 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
burt Posted November 5, 2013 Posted November 5, 2013 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.
npn2531 Posted November 5, 2013 Author Posted November 5, 2013 I see! I did not know you could do that. Thanks! ps - it works just fine, <?php echo ENTRY_DATE_PURCHASED . tep_date_short($order->info['date_purchased']); ?> comes out: Date Purchased 10/05/2013 Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120
Recommended Posts
Archived
This topic is now archived and is closed to further replies.