I am trying to compare two dates which are in Finnish time form like this: dd.mm.YYYY or d.m.YYYY or dd.m.YYYY or d.mm.YYYY.
I am having a hard time finding out how to d
Using the Date object:
Date
var today = Date.today(); var dateToday = Date.parse(today.toString('MMMM d, yyyy')); var prevMonthDate = dateToday.addDays(-30); var difference = (dateToday - prevMonthDate)/86400000; console.log(difference); //will give you the difference in days.