views:

846

answers:

1

I need to format the date in an email template. The date gets included in the plain .html email as follows.

Dispatch Date: {{var order.getShippingDate()}}

Is there any way I can format this date? I've tried just using the standard php date() function to format it to no avail.

A: 

strtotime any help? It can parse a data back to a unix timestamp, which is what date() expects as an input.

edit after comment:

You can try creating a custom version of app/code/core/mage/sales/model/order.php under the app/code/local folder (it goes here so magento updates don't overwrite it). It contains a method called getCreatedAtFormated - you could apply the same principle to the shipping data and see if that achieves what you need to do.

benlumley
Nope... it doesn't let me use any php functions inside of the curly braces.Remember, this is in a .html file, so I guess the problem lies with the way that Magento parses the file.
Remy
ah yeah, of course. forgot that.
benlumley
Sweet... that was it! Thanks!
Remy