From 282eb921a761f8403b498ad9a21b622fbe8ac9f6 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 18 Oct 2010 02:31:03 +0200 Subject: [PATCH] fixed bug in time parsing --- backend/lib/Interpreter/Interpreter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/lib/Interpreter/Interpreter.php b/backend/lib/Interpreter/Interpreter.php index 10105c4..94f26ba 100644 --- a/backend/lib/Interpreter/Interpreter.php +++ b/backend/lib/Interpreter/Interpreter.php @@ -180,12 +180,12 @@ abstract class Interpreter implements InterpreterInterface { * @return float */ protected static function parseDateTimeString($string, $now) { - if ($ts = strtotime($string, $now / 1000)) { - return $ts * 1000; - } - elseif (ctype_digit($string)) { + if (ctype_digit($string)) { return (float) $string; } + elseif ($ts = strtotime($string, $now / 1000)) { + return $ts * 1000; + } else { throw new \Exception('Invalid time format: ' . $string); } @@ -197,4 +197,4 @@ abstract class Interpreter implements InterpreterInterface { public function getUuid() { return $this->channel->getUuid(); } } -?> \ No newline at end of file +?>