diff --git a/include/utils/utils.php b/include/utils/utils.php index a5a4e1b4afc5a9cae97a69f0c1d846f638b11bab..7f5f69364287b96db81f94b19f4c7a57b1282aad 100755 --- a/include/utils/utils.php +++ b/include/utils/utils.php @@ -1803,7 +1803,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;