0

I have a video player which is returning seconds while playing video. Now I have startTime and endTime which are in HH:mm:ss:ss format (eg. 00:06:29:50). I want to check if the current second is in between the startTime and endTime.

I tried to convert seconds and startTime/Endtime into unix format using dayJS but it won't work. Can someone please provide me a better idea?

  • Welcome to Stack Overflow! Please visit the [help], take the [tour] to see what and [ask]. Do some research - [search SO for answers](https://www.google.com/search?q=javascript+time+within+range+site%3Astackoverflow.com). If you get stuck, post a [mcve] of your attempt, noting input and expected output using the [\[<>\]](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. – mplungjan Jun 07 '22 at 13:44
  • Converting HH:mm:as to a number of seconds is some multiplication and addition. – Dave Newton Jun 07 '22 at 13:45
  • Apart from the dupes: https://day.js.org/docs/en/plugin/is-between – mplungjan Jun 07 '22 at 13:50

0 Answers0