datemath-to-milliseconds
Convert any date math string to milliseconds. Check Elastic's documentation for further reading (Note: rounding and conditionals are not supported yet).
Install
npm install datemath-to-milliseconds --save
Examples
var convert = ; console;// => -15000 console;// => 300000 console;// => -25200000 console;// => 345600000 console;// => -1814400000 console;// => 5184000000 console;// => -31536000000 console;// => -27845715000