How can I calculate the number of days between two dates?

In EZ Exporter, it's possible to subtract 2 dates and get the number of days between them using Calculated Fields.

For example, you might want a custom column in your CSV that tells you the number of days between when an order was created and when a refund was issued.

The formula below can take care of this:

(to_datetime({{ refunds.last_refund.created_at }}) - to_datetime({{ created_at }})).days

App: EZ Exporter

Tags: advanced features, calculated fields