New Date returning wrong date on iOS


I’m doing a very simple operation to add an event to a calendar.
On Android when i do something like
startDate = new Date(‘2018-09-08T14:00:00’)
startDate as the correct value of Sat Sep 08 2018 14:00:00 GMT+0200 (CEST)

But when running on iOS the same code set startDate to this value :
Sat Sep 08 2018 16:00:00 GMT+0200 (CEST)

I do believe it’s link to safari but i can’t figure out what is going on.

I’m not sure if new Date() naturally supports an ISO string as input, it should but it’s possible Safari hasn’t implemented it.
You could try something like this instead:
new Date(year, month, day, hours, minutes, seconds, milliseconds)
in your case
new Date( 2018, 09, 08, 14, 0, 0, 0 )
You can find more options here: