OK.. So I have this plugin that generates for me an array of dates. The problem is I cannot modify this plugin as it's embedded in the apps core and it takes data from a central database.
So here's the issue, the array of dates has the local timezone offset applied, so basically elements look like this:
0: Thu Apr 11 2019 00:00:00 GMT+0100 (hora de verano de Europa occidental)
1: Fri Apr 12 2019 00:00:00 GMT+0100 (hora de verano de Europa occidental)
I need to pass this array to a web service (using axios), so when I do
JSON.stringify(MyArray)
The value is converted to a text format time with the timezone offset applied:
"2019-04-10T23:00:00.000Z"
As you can see, instead of showing 00:00:00
it shows 23:00:00
and the day before the actual date, as the timezone offset is applied
Is there any workaround? maybe something to convert the full array to GMT or make JSON.stringify
to ignore the timezone??