diff --git a/include/utils/utils.php b/include/utils/utils.php
index 8f567566d834c4b281a0484dad6b294b8e5cb328..3117f31ebb4dfb8b92f690e724a29e4b5bfc2e0c 100755
--- a/include/utils/utils.php
+++ b/include/utils/utils.php
@@ -1804,7 +1804,12 @@ function getValidDBInsertDateValue($value) {
 			break;
 		}
 	}
-	list($y,$m,$d) = explode('-',$value);
+	global $current_user;
+	$formate=$current_user->date_format;
+	list($d,$m,$y) = explode('-',$value);
+	if(strlen($d)==4||$formate=='mm-dd-yyyy'){
+		list($y,$m,$d)=explode('-',$value);
+	}
 	if(strlen($y) == 1) $y = '0'.$y;
 	if(strlen($m) == 1) $m = '0'.$m;
 	if(strlen($d) == 1) $d = '0'.$d;