I'm trying to do export excel using alasql where I'm transforming the date that I'm getting from JSON ("10 Jun 2018") to MM/DD/YYYY (6/10/2018) format as shown below:
var date="12 Apr 2018";
function trandformDate(date){
return new Date(date);
}
However on export to excel I'm seeing the date 1 day less than the actual date ie.,6/9/2018
I tried by incrementing the date by doing this..But didn't work
var date="12 Apr 2018";
function trandformDate(date){
return new Date(date.setDate(date.getDate() + 1));
}
Please let me know how can I get the exact date using javascript..thanks