I have a problem. In my code I have the following line:
$RunDateTimeGMT0 = "2017-12-31 23:00:00";
The goal is to get the previous and next hour, so I tried this:
$RunDateTimeGMT0 = "2017-12-31 23:00:00";
$epochRunDateTimeGMT0 = strtotime($RunDateTimeGMT0);
$previousEpochDateTimeGMT0 = $epochRunDateTimeGMT0 - 3600;
$nextEpochDateTimeGMT0 = $epochRunDateTimeGMT0 + 3600;
But then the I get the following result:
previousEpochDateTimeGMT0 -> 2017-12-31 21:00:00
nextEpochDateTimeGMT0 -> 2017-12-31 23:00:00
Because of my timezone (+1) the RunDateTimeGMT0 gets converted to a date of my timezone.
I want the following result:
validEpochDateTimeGMT0 -> 2017-12-31 22:00:00
nextEpochDateTimeGMT0 -> 2018-01-01 00:00:00
How can I keep the date object UTC?
), after the 3600, must cause an error message?