Mautic Community Forums

Convert text to date

Hi



I’m using the Zapier email parser to create / update contacts via the Mautic API Zap. When trying to pull in a date, the format doesn’t match the Mautic date field, and refuses to save the date.



Problem is that the system that generates the email uses MM/DD/YYYY as the date format, but Mautic will only accept the date as YYYY-MM-DD. I have no way to change the date format in the email.



As a workaround I’m using text fields to store the date but as I would prefer to store in a date field.



Anyone have any suggestions?



Thanks

Hi

I’m using the Zapier email parser to create / update contacts via the Mautic API Zap. When trying to pull in a date, the format doesn’t match the Mautic date field, and refuses to save the date.

Problem is that the system that generates the email uses MM/DD/YYYY as the date format, but Mautic will only accept the date as YYYY-MM-DD. I have no way to change the date format in the email.

As a workaround I’m using text fields to store the date but as I would prefer to store in a date field.

Anyone have any suggestions?

Thanks

Zapier have a formatter:
https://zapier.com/help/formatter/#what-triggers-and-actions-does-formatter-support

I haven’t used Zapier before, but if you can add an extra step in between the parser and the mautic api you could format the date through that before sending it on.

Another possibility would be to send the email to a script which used regular expressions to format the date before sending it on to the email parser, but you’d have to write the script and work out how to get the data into and out of it.