I'm currently working on a website that runs on various devices (Apple, Windows, smartphone, tablet, laptop). From my backend PHP script, datetimevalues in string format are sent to my JavaScript. When I run this code on my laptop (Windows-Chrome) I got a different time than when I ran it on my smartphone (Apple - Safari). On my smartphone it shows an hour too much. How can I fix this to get the same values to process in further code? I would like to keep the PHP as it is if possible.
PHP string value:
2019-01-01 01:00:00
On my webpage I've tested this code,
var phpValue = "<?php echo $tijdCountdownPauze; ?>";
var phpValueSplitted = phpValue.split(" ");
var phpvalueCombine = phpValueSplitted[0] + "T" + phpValueSplitted[1];
var phpValueCombinedDate = new Date(phpvalueCombine);
document.write(phpValueCombinedDate);
document.write("<br>");
Output of Windows laptop in Chrome:
Tue Jan 01 2019 01:00:00 GMT+0100 (Midden-Europese standaardtijd)
Output of Apple iPhone in Safari:
Tue Jan 01 2019 02:00:00 GMT+0100 (CET)