RE: How to set date format MM-DD-YYYY for Inbound E-Document
Hello!
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!
You can try using Freemarker’s Date/Time Format Settings: https://freemarker.apache.org/docs/ref_directive_setting.html#topic.dateTimeFormatSettings
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">