diff --git a/include/utils/utils.php b/include/utils/utils.php
index ad9ec269eaccfb49cd29c2a59c82a940037285ee..038f04c678aabeb425bab5fe391b561f113945c5 100755
--- a/include/utils/utils.php
+++ b/include/utils/utils.php
@@ -1827,7 +1827,7 @@ function getValidDBInsertDateTimeValue($value) {
 	$value = trim($value);
 	$valueList = explode(' ',$value);
     //checking array count = 3 if datatime format is 12hr.
-	if(count($valueList) == 2 || count($valueList) == 3) {
+	if(is_array($valueList) && (count($valueList) == 2 || count($valueList) == 3)) {
 		$dbDateValue = getValidDBInsertDateValue($valueList[0]);
 		$dbTimeValue = $valueList[1];
 		if(!empty($dbTimeValue) && strpos($dbTimeValue, ':') === false) {
@@ -1843,7 +1843,7 @@ function getValidDBInsertDateTimeValue($value) {
 		} catch (Exception $ex) {
 			return '';
 		}
-	} elseif(count($valueList == 1)) {
+	} elseif(is_array($valueList) && count($valueList) == 1) {
 		return getValidDBInsertDateValue($value);
 	}
 }