fixed bug in time parsing

This commit is contained in:
Steffen Vogel 2010-10-18 02:31:03 +02:00
parent 333ab96763
commit 282eb921a7

View file

@ -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(); }
}
?>
?>