Timestamp difference not equal in all minutes

Hi @Dmitry Gudkov

Introductory explanation:

  • I have a date with time accurate to the second in text format in a csv file.

  • I read this information into EM and convert this text of the text-format into a date-format number.

  • The measurements are in an interval of one minute. The seconds can only differ depending on when the measurement protocol is started.

What doesn't work for me:

  • I have noticed that when I calculate the time difference later, I get differences in EM, even though the time difference is the same. (In my eyes)
    In this example you can see the calculation of exactly one minute each
    The results differ in the 10th place.

But I need the same "number" to put it together again. (See pictures)

Example only contains two calculations. (PS: Excel calculates correctly!)
In the project there are x calculations.

Timestamp_Diff_Not_Equal.morph (6,1 KB)
Timestamp_Diff_Not_Equal.xlsx (10,4 KB)

Well, I would argue that Excel calculates incorrectly. Take only the fractional parts of the values and use any calculator to calculate the difference:

6937615741 - 6930671296 = 6944445
6944560185 - 6937615741 = 6944444

So you see, EasyMorph calculates the diff correctly.

What you see as formatted timestamp is rounded. For instance, two values may appear as formatted timestamps

2024-05-21 16:41:00
2024-05-21 16:41:00

But their numerical representation can be slightly different.

If you need the diffs to be equal as well, you need to round them too. EasyMorph has a number of rounding functions:

  • round()
  • roundxl()
  • mround()
  • truncate()
  • ceiling()
  • floor()

Pick one that works best in your case.

See all the number functions here: syntax:functions [EasyMorph Help]