Suppose a situation where you want to store data in a way like <current_time+10min>
but every time current_time + 10 mins return a new value, we want to settle time in a way like a store at 00, 10, 20,30,40,50 min slot.
See some example
Slot for 10 minute interval
23 Oct, 2023 17:23:32
===> 23 Oct, 2023 17:30:00
23 Oct, 2023 17:53:32
===> 23 Oct, 2023 18:00:00
23 Oct, 2023 23:53:32
===> 24 Oct, 2023 00:00:00
Slot for 60 minute interval23 Oct, 2023 17:13:32
===> 23 Oct, 2023 18:00:00
23 Oct, 2023 23:53:32
===> 24 Oct, 2023 00:00:00
Here I used the node.js moment library to give you the solution: