fixed bug in time parsing
This commit is contained in:
parent
333ab96763
commit
282eb921a7
1 changed files with 5 additions and 5 deletions
|
@ -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(); }
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Add table
Reference in a new issue