Workflows fail due to bad date

Any date function I add to a workflow makes the workflow fail with an error:

Bad date 2019-05-01 19:45:00 for format m/d/Y H:i

As an example a formula I am using is:
{addMonths(Y-m-d; {P0}; {P1})}
where P0 is the Start Date Raw Value and P1 is an integer

But the same thing seems to happen with any date function I try.

Any ideas?


Hi Steve, I have shared some date formate. Please check.

yyyy-mm-dd hh:mm:ss.s

in html format :-

in javascript:-- var d = new Date();

in php: date(format,timestamp)

Hope it is helpful for you.

Thanks, but there doesn’t seem to be anything I can do with the format to resolve it. I even tried:
{date(m/d/Y H:i; {addMonths(m/d/Y H:i; {date(m/d/Y H:i; {P0})}; {P1})})}

It seems like whatever format I use, the workflow is using format Y/m/d H:i and fails

hi Steve

Have you tried changing the user’s date format?

alican, you are right. That seems to have worked. It seems odd that a users date format selection could break a workflow but it seems to be working for now. Thanks a lot.

I take that back. It still isn’t working. Now the workflow is ‘completed’ but that field is not calculated and I get the following error in suitecrm.log.

Bad date 2019-05-01 19:45:00 for format m/d/Y H:i

I have changed the default date format and the user date format. The format listed in the error m/d/Y H:i isn’t used anywhere unless its a php setting or something I am not aware of.

The function is just adding an integer to the startdate
{addMonths(m-d-Y H:i; {P0}; {P1})}. It shouldn’t get much simpler than that.