Date difference

Hello. I’m new here. I’m trying to calculate the difference between today’s date and upd date (format “XXXX-XX-X XX:XX:XX”), in days.

I’m trying this but no luck.
{{(now - formatDate(get(5.data.prestashop.order.date_upd; 0); yyyy-MM-dd HH:mm:ss; X)) / 86400}}

Any idea ?

Thanks

Arthur

1 Like

@a_gio
Hi, welcome to make community!

Here is a screenshot and an expression using the function for your reference.
Please change ${baseDate} to any value you get from Module etc.
{{(formatDate({{now}}; X) {{-}} formatDate(${baseDate}; X)) {{/}} 86400

Thanks. I get this error :
Cannot initialize the scenario because of the reason ‘Scenario validation failed - 1 problem(s) found.’ - Invalid reference in filter ‘0-2’ on link ‘fin’: Invalid IML.

1 Like

Thanks also for the screenshots!
Please enclose ( and ) and ; with {{}}. And please remove the unnecessary brackets.

This works {{(formatDate(now; “X”) - formatDate(5.data.prestashop.order.date_upd; “X”)) / 86400}}

Thanks a million

3 Likes

@a_gio
I am happy to have been able to help!
I am sorry to trouble you, but please just specify the Solution.

Ref: 📚 Mastering the Make Community: Get Started

1 Like

I followed your advice below

Thanks again

2 Likes