I want something like this
moment().endOf('day').fromNow().milliseconds();
someone can help ?
Join Stack Overflow to learn, share knowledge, and build your career.
I want something like this
moment().endOf('day').fromNow().milliseconds();
someone can help ?
You can use diff and subtract current date from end of day. Difference is in milliseconds
var result = moment().endOf('day').diff(moment())
console.log(result, moment(result))
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>