Title: DATEDIFF Function not working
Last modified: January 15, 2019

---

# DATEDIFF Function not working

 *  Resolved [facil2000](https://wordpress.org/support/users/facil2000/)
 * (@facil2000)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/)
 * Hi,
 * Is it possible that the function DATEDIFF is not working?
 * I am trying all the possible ways…
 * Is it right?
 * DATEDIFF(fieldname17, fieldname15, dd/mm/yyyy, y)
 * Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11089216)
 * Hello [@facil2000](https://wordpress.org/support/users/facil2000/),
 * What is the version number of your copy of the plugin?
 * The DATEDIFF operation is included in the Date/Time operations module distributed
   with the Developer and Platinum version of the plugin.
 * Concerning to the equation you sent me as reference, the third and fourth parameters
   in the DATEDIFF operation are texts, so, the should be enclosed between single
   or double quotes, as follows:
 *     ```
       DATEDIFF(fieldname17, fieldname15, 'dd/mm/yyyy', 'y')
       ```
   
 * Furthermore, this operation returns an object, so, if you want to know the Years,
   Months and Days between both dates, the correct equation would be:
 *     ```
       (function(){
       var obj = DATEDIFF(fieldname17, fieldname15, 'dd/mm/yyyy', 'y');
       return obj['years']+' year(s), '+obj['months']+' month(s) and '+obj['days']+' day(s)';
       })()
       ```
   
 * Best regards.
 *  Thread Starter [facil2000](https://wordpress.org/support/users/facil2000/)
 * (@facil2000)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11089328)
 * Thank you so much for your promot response!!!
 * I used DATEDIFF(fieldname17, fieldname15, ‘dd/mm/yyyy’, ‘y’), just like this 
   but it does not work…
 * fieldname15 and fieldname17 are Field Type: Date Time and the date formar is 
   dd/mm/yyyy
 * I don’t know what I am doing wrong…
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11089335)
 * Hello [@facil2000](https://wordpress.org/support/users/facil2000/),
 * If you want return the difference in years between dates, the code of the equation
   would be:
 *     ```
       DATEDIFF(fieldname17, fieldname15, 'dd/mm/yyyy', 'y')['years']
       ```
   
 * If the issue persists, please, send me the url to the webpage with the form inserted
   to check your code in action.
 * Best regards.
 *  Thread Starter [facil2000](https://wordpress.org/support/users/facil2000/)
 * (@facil2000)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11089370)
 * Thanks
 * The issue still persists. This is a test link for you to see.
 * [https://estudiowls.com.ar/test/](https://estudiowls.com.ar/test/)
 * Thanks again
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11089387)
 * Hello [@facil2000](https://wordpress.org/support/users/facil2000/),
 * You’re using the free version of the plugin (v1.0.278), and as I said in a previous
   ticket, the DATEDIFF operation belongs to the Date/Time operations module, distributed
   only with the Developer and Platinum versions of the plugin.
 * Best regards
 *  Thread Starter [facil2000](https://wordpress.org/support/users/facil2000/)
 * (@facil2000)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11090826)
 * I am sorry I didn’t see what you say in your previous ticket.
 * Sorry for the inconvenience

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘DATEDIFF Function not working’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [facil2000](https://wordpress.org/support/users/facil2000/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/datediff-function-not-working/#post-11090826)
 * Status: resolved