About EasyMorph Tutorials & Examples Web-help

Date / Hour Difference issue

Hi,
Based on a real case, I try to calculate a duration through a simple substract, but I got strange results from time to time.
The begin and end hours are typed in Excel in a time format : hh:mm:ss
Duration%20issue%201

After import in EasyMorph, I’ve got the following issue
18:00:00 - 17:30:00 = 12:30:00 (and not 0:30:00 as expected)
empty - empty = 12:00:00 (and not 00:00:00)

Any idea?Test Planning.xlsx (11.1 KB)
Duration issue.morph (2.2 KB)

Hi Michel. Use format HH:mm:ss (24-hour) instead of hh:mm:ss (12-hour).

Thanks Dmitry!!! Work perfectly now.

Anyway, strange result with the 12 hours formatting…

Have a good day :slight_smile:

Hi,
I try to calculate a duration through a simple substract between two time (not datetime case) format HH:mm:ss, Fx : format([theo_hour]-[Real_hour], ‘HH:mm:ss’) I followed this topic but I have error msg ‘’ #Can’t subtract not numbers’’
help pls

Dates in EasyMorph are numbers, like in Excel.

The error indicates that in [theo_hour]-[Real_hour] either the left or the right part is not a number in some row. Make sure that both [theo_hour] and [Real_hour] are numbers before subtracting them. If needed, use the “Convert data types” action to convert text dates into numbers.

doesn’t work !

Show a sample value from the column and the format string from the “Convert data types” action.

To learn more about EasyMorph visit easymorph.com.