I try to build jquery countdown timer, but the end date is in mysql database with timestamp custom format
here is my saved date in database.
2019-01-09 12:48:29
That date is GMT+0000 which is UTC. But when I try to show it in javascript like below
var countdown = new Date("<?php echo $getDate['date_end'];?>");
console.log(countdown);
It will show output
Wed Jan 09 2019 12:48:29 GMT+0700 (GMT+07:00)
That's is wrong, because when I save the $getDate['date_end'] to my database is in UTC format (+0000) why it becomes GMT +0700 in javascript?
I try to convert it to UTC with this code
var countdown = new Date("<?php echo $getRound['date_end'];?>");
var a = countdown.toUTCString();
console.log(a);
but the output will give different hours
Wed, 09 Jan 2019 05:48:29 GMT