Developer forum

Forum » Templates » Formatting order date

Formatting order date

Filip Lundby
Reply

In my order-mail-template I would like to format the order date into MM-DD-YY. Can this be done with DW tags? Right now <!--@Ecom:Order.Date--> returns MM-DD-YYYY. 

I'm on DW version 8.1.2.6, so I cannot use Razor.


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Filip

You can use the date tag extensions:

http://templates.dynamicweb.com/TemplateTags/Dynamicweb-template-tags/General-tags/Tag-extensions.aspx

Nicolai

 
Filip Lundby
Reply

Like so?

<!--@Ecom:Order.Date.FormatDate("dd-MM-yy")-->

But this only works with 8.5+, right?

 
Mikkel Ricky
Reply
This post has been marked as an answer

Try this link: http://templates.dynamicweb.com/TemplateTags/Dynamicweb-template-tags/General-tags/Date/time-tag-extensions.aspx

Use them like this

<!--@Ecom:Order.Date.Year-->, <!--@Ecom:Order.Date.Month-->, …

Best regards,
Mikkel

Votes for this answer: 1
 
Filip Lundby
Reply

Thanks Mikkel, but *.Year returns "2014" not "14". Looks like I'm out of luck.

 
Nicolai Høeg Pedersen
Reply

Hi Filip

You can see the list of possibilities on the link we provided you. You can also use DwTemplateTags to see what is in the copntext you are in.

You can always make an upgrade and get new features. We cannot move new features to your old version, sadly enough...

 
Mikkel Ricky
Reply

Why don't you want to report the year as 2014? We live in the year 2014 and more than 14 years ago we realized that we should use 4 digits to represent this fact.

Have you tried using <!--@Ecom:Order.Date.Year.Remove(2)-->?

 
Filip Lundby
Reply

Thanks Nicolai and Mikkel. @Mikkel: The mail is not for humans, but for another system to receive - so the date format is important.

<!--@Ecom:Order.Date.Year--> - will have to do for now. Thank you for your input.

 

You must be logged in to post in the forum