Find the closest time from a list of times

后端 未结 11 810
眼角桃花
眼角桃花 2020-12-02 23:48

So, here\'s the scenario. I have a file with a created time, and I want to choose a time from a list of times that that file\'s created time is closest or equal too...what w

11条回答
  •  爱一瞬间的悲伤
    2020-12-03 00:16

    Use the minimum absolute time difference between the file time and the time in the list. You might get 2 entries being the same, and then you would need a different method to differ between these.

提交回复
热议问题