0

I am trying to make a call to getMetricData api for aws connect using nodejs sdk from a lambda function.Docs

I am having issue with StartTime and EndTime parameters. No matter what values I pass, I always get some error or the other.

EndTime: new Date().getTime()
StartTime: EndTime-24
//returns starttime and endtime must be separated by 24 hrs.

I also get an error saying - time must be a multiple of 5

Has anyone got any success in making this work? How can I pass StartTime and EndTime dynamically for today's date in epoch and also make sure that they are a multiple of 5?

Naxi
  • 1,504
  • 5
  • 33
  • 72
  • I think this could be useful: https://stackoverflow.com/questions/10789384/round-a-date-to-the-nearest-5-minutes-in-javascript – OARP Jan 13 '22 at 19:17
  • This is missing debugging info - I recommend [taking the tour](https://stackoverflow.com/tour), as well as reading [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and [what's on topic](https://stackoverflow.com/help/on-topic). Especially regarding reproducible code. – Ermiya Eskandary Jan 13 '22 at 20:08

0 Answers0