I have a code like this where I have my date and current/today date and I need to get difference in days between two dates. I always get 0 or some big number "31536000000" Whats wrong?
const startDate = moment(job.published_date, 'YYYY-MM-DD').format('YYYY,MM,DD') //looks like this "2018,08,19"
const endDate = moment(new Date()).format('YYYY,MM,DD') //looks like this "2019,09,12"
const a = moment([ startDate, ])
const b = moment([ endDate, ])
console.log('DIFFERENCE IN DAYS', b.diff(a))