I'm working with a PHP Api witch gives me this json:
{
"title": "hemen",
"category": "time",
"start": "2021-09-27T09:22:00+00:00",
"end": "2021-09-27T13:22:00+00:00",
"isAllDay": false,
"calendar": [{"id": 1}],
"body": null
}
The problem is that in my frontend (Vue) I'm convering the start and end dates to datetime but it adds 2 hours and I don't know why or the best option to fix it.
axios.get('/api/schedules.json').then(function (response) {
let dataOri = response.data;
// convert
dataOri.forEach(element => {
element.start = moment(element.start, "YYYY-MM-DDTHH:mm:ssZ").format("YYYY-MM-DD HH:mm:ss");
console.log(element.start); // prints '2021-09-27 11:22:00' instead of '2021-09-27 09:22:00'
element.end = moment(element.end, "YYYY-MM-DDTHH:mm:ssZ").format("YYYY-MM-DD HH:mm:ss");
console.log(element.end); // prints '2021-09-27 15:22:00' instead of '2021-09-27 13:22:00'
});
self.filterSchedules = dataOri;
});