Date ranges made easy
Several of the MSP API require a timespan in epoc format. I wrote a script to subtract a number minutes and hours before the current time and now and present both in epoc format. This gives you a "start" and "end" time for the APIs.
$ epocdate.sh
How many minutes before now?
10
You entered 10 minutes
How many hours before now?
24
You entered 24 hours
Start: 1662508276 Tuesday, September 06, 2022 16:51
End: 1662595276 Wednesday, September 07, 2022 17:01
https://gist.github.com/mbierman/f81b591fd27638b9f4221e9525229eca
I might change this so that the end time can be calculated as well if there's any interest.
Please sign in to leave a comment.
Comments
0 comments