Title: Hour TIme Addition
Last modified: July 12, 2020

---

# Hour TIme Addition

 *  Resolved [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * (@graicifyd)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/)
 * Hello,
 * I was trying to subtract two date fields that have only time option checked but
   the I am getting incorrect results in decimals. Please what can I do.
 * I need the difference between two time fields. fieldname 2 – fieldname1 (with
   only time option checked)

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

 *  Thread Starter [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * (@graicifyd)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/#post-13111309)
 * I will also like to set one of the date fields to show the current time. I can
   show set the default date to current day with ‘1’ how can I set the current time
   as default?
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/#post-13111427)
 * Hello [@graicifyd](https://wordpress.org/support/users/graicifyd/)
 * Please, edit the equation a follows:
 *     ```
       (function(){
           var d = ABS(fieldname1-fieldname2)*86400, 
           h = FLOOR(d/(60*60)),
           m = ROUND(d%(60*60)/60);
           return IF(h<10, '0'+h, h)+':'+IF(m<10, '0'+m, m);
       })()
       ```
   
 * By default, the selected time in the date/time fields would be the current time.
 * Best regards.
 *  Thread Starter [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * (@graicifyd)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/#post-13111518)
 * Thank you.
 * I have tried it but the difference remains as 00:00, see the calculator [here](https://aimhighwriting.com/sample-calculator/)
   on the second page.
 * Due time is Fieldname102
 * the Default time is the one below which is fieldname103
 * I intend finding the difference between the due time selected and the default
   time, it’s only the difference in hour I need, I don’t need the minute.
 * Thank you for your support.
 * Th
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/#post-13111717)
 * Hello [@graicifyd](https://wordpress.org/support/users/graicifyd/)
 * Please, even if you’ve configured the date/time fields to display only the time
   components, you should tick the choices for the days (Sun, Mon, Tue, Wed, Thu,
   Fri, Sat) in their settings.
 * Best regards.
 *  Thread Starter [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * (@graicifyd)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/#post-13112219)
 * Thanks, this worked perfectly.

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

The topic ‘Hour TIme Addition’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/hour-time-addition/#post-13112219)
 * Status: resolved