Clock duration block have negative sign result

Here is my block using clock duration block

Here are the result




when i reverse from PM to AM got negative sign result, althought calculated correctly.

Hello GMK Soft,

You are correct, the Clock returns negative values when calculating the duration between two instants. It simply subtracts the former from the latter. To do this, add the math absolute block before the Duration block.

math_abs

This returns the absolute value of a number, which is the distance between a number and 0. If the number is positive, no changes; if the number is negative, it will make it positive.

Regards.

1 Like

The Time Picker returns a time within one day.

If you plan on adding date boundaries, add date pickers.

Thanks @gordonlu310 everything is now working

Here is the revised block

Results


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.