More time/date issues

I am strugling yet again with time and date in scripts since win 10 update.

I have this script;

function ticketDateFormatted(inputDate){

    var newDateParse                                                = new Date(inputDate);                                                                            //--define date of calculated end

    var ticketDateFormattedValue                                    = newDateParse.valueOf();                                                                                    //--numerical value of calculated end

    var ticketDateFormattedYear                                        = newDateParse.getYear();                                                                            //--End date breakdown

    var ticketDateFormattedMonth                                    = newDateParse.getMonth()+1;                                                                                    //--get date month

    var ticketDateFormattedDay                                        = newDateParse.getDate();                                                                                     //--get date day

    var ticketDateFormattedHours                                    = newDateParse.getHours();                                                                                    //--get date hour

    var ticketDateFormattedMinutes                                    = newDateParse.getMinutes();                                                                                    //--get date minutes

    var ticketDateFormattedSeconds                                    = newDateParse.getSeconds();                                                                                    //--get date seconds

    var ticketDateFormattedResponse                                    = ticketDateFormattedYear+'-'+ticketDateFormattedMonth+'-'+ticketDateFormattedDay+' ';                                                //--End date formatting for sql

    ticketDateFormattedResponse                                        += ticketDateFormattedHours+':'+ticketDateFormattedMinutes+':'+ticketDateFormattedSeconds;

    return ticketDateFormattedResponse

}

Which previously worked fine… but again it seems to have stopped working…
If I run

ticketDateFormatted('2016-06-09 10:10:10')

I get;

NaN-NaN-NaN NaN:NaN:NaN

If I change to 09-06-2016;

ticketDateFormatted('09-06-2016 10:10:10')

It works returning;

2016-9-6 10:10:10

Not sure whats going on.

The time settings on machine are;

Advice greatly apreciated.

You can try DateTime class instead. JScript date class may not obey to local date time settings.

Specifically you can try Parse method. You can find more info here.

Thanks, will look into that, its just puzzling as it was fine then I had to asjust last week and was working and now again it is playing up…
Last time it seemed to be trying to do american month/day so fixed now am getting NaN…

Hmmm, dates do my head in.
Couldnt get to grips with that link.
Ended up finding that I didnt need to format anymore, not sure why I had to before and why my solution now doesnt work but I can use the value straight from the SQL query… hmmmmmm.
ANyway seems to be working again now LOL