I'm getting crazy with showing a date correctly to the client:
From the API I receive data.expiry_date
and its value is: 2017-09-06T23:59:59Z
The client to show that data looks like this:
var date = new Date(data.expiry_date);
$('#expiry_date').val(`${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`);
The result is a day before than expected: it should be 06/09/2017 but it show 07/09/2017.
Basically the date
value from the action var date = new Date(data.expiry_date);
is: Thu Sep 07 2017 01:59:59 GMT+0200 (CEST)
.
How can I get rid of it?