Calculation based on the number of hours between 2 hours filled in by the user

[ad_1]

Hi,

Already a big thank you for this plugin which seems very useful! I wanted to know if is it possible to calculate the number of hours between 2 hours in the format (HH:mm) entered by the user and then make a calculation based on the number of hours between the 2 hour window to display the end result to the user?

Example :

The user fills in the form the first hour $hours1: 6:51 pm and the second hour $hours2: 5:27 am (the next morning)

Is the plugin able to do this calculation to retrieve the hour interval between these 2 variables:

$interval = $hours2 – $hours1

In our example = [05:27 + 1 day] – [18:51] = 10:36 (10 hours and 36 minutes)

Then divide by 3 the interval $interval_third=$interval/3 = [10:36] /3 = 3:32 (3 hours and 32 minutes) and print this hour to the user.

Is it possible to do this calculation first before going a little further? If yes, how ?

Many thanks in advance!

  • This topic was modified 3 hours, 50 minutes ago by ssams25.
  • This topic was modified 3 hours, 49 minutes ago by ssams25.
  • This topic was modified 3 hours, 42 minutes ago by ssams25.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer