@@ 4224-4229 (lines=6) @@ | ||
4221 | } |
|
4222 | ||
4223 | switch ($this->getConfig('datetime_format')) { |
|
4224 | case 'YYYY/mm/dd': |
|
4225 | if (!preg_match('/^\d{4}\/\d{2}\/\d{2}[\d :]*$/', $str)) { |
|
4226 | return ''; |
|
4227 | } |
|
4228 | list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); |
|
4229 | break; |
|
4230 | case 'dd-mm-YYYY': |
|
4231 | if (!preg_match('/^\d{2}-\d{2}-\d{4}[\d :]*$/', $str)) { |
|
4232 | return ''; |
|
@@ 4230-4235 (lines=6) @@ | ||
4227 | } |
|
4228 | list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); |
|
4229 | break; |
|
4230 | case 'dd-mm-YYYY': |
|
4231 | if (!preg_match('/^\d{2}-\d{2}-\d{4}[\d :]*$/', $str)) { |
|
4232 | return ''; |
|
4233 | } |
|
4234 | list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); |
|
4235 | break; |
|
4236 | case 'mm/dd/YYYY': |
|
4237 | if (!preg_match('/^\d{2}\/\d{2}\/\d{4}[\d :]*$/', $str)) { |
|
4238 | return ''; |
|
@@ 4236-4241 (lines=6) @@ | ||
4233 | } |
|
4234 | list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); |
|
4235 | break; |
|
4236 | case 'mm/dd/YYYY': |
|
4237 | if (!preg_match('/^\d{2}\/\d{2}\/\d{4}[\d :]*$/', $str)) { |
|
4238 | return ''; |
|
4239 | } |
|
4240 | list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); |
|
4241 | break; |
|
4242 | /* |
|
4243 | case 'dd-mmm-YYYY': |
|
4244 | if (!preg_match('/^[0-9]{2}-[0-9a-z]+-[0-9]{4}[0-9 :]*$/i', $str)) {return '';} |