Calculate the time that passed between the insertion of one record and another

@yorman_steven_ladino How were you wanting to visualize this difference?

If possible, I would recommend using a single shift document with a start and stop timestamp, so you could first create the document with the start timestamp when a shift starts, and then update that document later to add a stop timestamp.

POST shifts/_doc/<shift_id>
{
  "start": "2020-03-23T03:04:15"
}

POST shifts/_update/<shift_id>
{
  "stop": "2020-03-23T09:00:00"
}

This is similar to what is described here: How to calculate the timestamp difference between two actions?

Then you could create a scripted field based on the difference between timestamps. There are some examples of doing date math in painless in this blog post if you want to learn more.