Difference between two times

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
ucevista
Veteran Member
Posts: 31
Joined: 2016-05-08 09:41

Difference between two times

Post by ucevista » 2016-05-08 10:14

Hi everybody.

I have a form made with Appgini and I have three time fields with format time. In the two first fields I input the start and end time and the third one has to have the difference between the two firsts fields.

For this I use the table_after_insert and table_after_update hooks into the table_dml.php. The formula I used is:

$data['difference'] = $data['end'] - $data['start'];

The line is executed but the result is incorrect. For example, if the inputs are 13:00 for start and 17:00 for the end the result obtained is 00:00:04. 4 is correct but it is shown as seconds and not as hours.

I have made my own data format for 24 hours time but the result is the same with any other format used.

What may be happening?

Thanks a lot for your replays.

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Difference between two times

Post by AhmedBR » 2016-05-08 20:12

Try Subtime function mysql, take a look at this topic:

http://forums.appgini.com/phpbb/viewtop ... ence#p4655
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

Post Reply