Calculate days between dates
-
Hi I am trying to calculate with cfdb-html output trans options the number of days between two dates that have been input into a form and submitted.
My form captures an arrival date and a departure date, both stored in the yyyy-mm-dd format. Using bcsub on these values directly does not produce a result.
e.g. arrival-date = 2016-07-15 and departure-date = 2016-07-17 therefore the number of days I am trying to calculate for these values is 2.
I have tried various combinations using date(d/m/Y,arrival-date) and strtotime(arrival-date) to try to convert these to values that will allow bcsub(departure-date,arrival-date,0) but am not getting the desired results.
Any advice on whether this is possible and how to get the right conversion/calculation would be greatly appreciated.
Ade
https://wordpress.org/plugins/contact-form-7-to-database-extension/
The topic ‘Calculate days between dates’ is closed to new replies.