Quantcast
Channel: SambaClub Forum - Latest topics
Viewing all articles
Browse latest Browse all 8860

More time/date issues

$
0
0

@JTRTech wrote:

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.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8860

Trending Articles