I have the code (19 is the day, 6 is the month)
var dateObj = new Date("19.6.2018");
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
newdate = day + '.' + month + '.' + year;
alert(newdate);
This code returns NaN.NaN.NaN
Function getUTCDate() returns a month. I do not know why.
I'm Slovak. The first number is the day. The second number is a month.