diff --git a/php/classes/TimeTableMgr.php b/php/classes/TimeTableMgr.php index 181cc7b..4244f65 100644 --- a/php/classes/TimeTableMgr.php +++ b/php/classes/TimeTableMgr.php @@ -342,8 +342,10 @@ class TimeTableMgr extends AmdaObjectMgr $doyRegex = '(\d{4}) (\d{2,3}) (\d{2}) (\d{2}) (\d{2})( \d{2})?'; if (preg_match('/^' . $doyRegex . ' ' . $doyRegex . '$/', $line)) { - $startDate = DateTime::createFromFormat($doyFormat, substr($line, 0, 17))->format($isoFormat); - $stopDate = DateTime::createFromFormat($doyFormat, substr($line, 18))->format($isoFormat); + $start = DateTime::createFromFormat($doyFormat, substr($line, 0, 17)); + $stop = DateTime::createFromFormat($doyFormat, substr($line, 18)); + $startDate = $start->sub(new DateInterval('P1D'))->format($isoFormat); + $stopDate = $stop->sub(new DateInterval('P1D'))->format($isoFormat); } else { $dateLength = round((strlen($line)-1) / 2); -- libgit2 0.21.2