How to set date format MM-DD-YYYY for Inbound E-Document


I’m trying to set the trandate while importing an XML using the Inbound E-Document functionality included in the Electronic Invoice.

I’m already getting the trandate like this:

“trandate”: “${XML[“cfdi:Comprobante”].@Fecha}”,

But the format from the XML is : “2019-10-21T12:00:00:00” and it needs to be MM-DD-YYYY.

Does someone knows how to convert the XML date to that format?


Thank you!

Rookie Asked on October 25, 2019 in SuiteScript.
Add Comment
2 Answer(s)

You can try using Freemarker’s Date/Time Format Settings:

I haven’t tested this myself, but you can try to add a settings macro somewhere in the template like so:

<#setting date_format="MM-dd-yyyy">

Beginner Answered on October 30, 2019.
Add Comment

Hi Eric!

Thank you very much for your answer.

Unfortunately I tried including the settings macro and still gives me an error for the date format .

Rookie Answered on October 30, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor