Skip to content

Commit

Permalink
Merge pull request #23708 from eileenmcnaughton/date
Browse files Browse the repository at this point in the history
dev/core#2325 Fix handling of seconds on import
  • Loading branch information
monishdeb authored Jun 7, 2022
2 parents ed4c0b2 + 110eeb3 commit c7e9b07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Utils/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ public static function formatDate($date, $dateType) {
$ruleName = 'date';
if ($dateType == 1) {
$matches = [];
if (preg_match("/(\s(([01]\d)|[2][0-3]):([0-5]\d))$/", $date, $matches)) {
if (preg_match("/(\s(([01]\d)|[2][0-3]):([0-5]\d):?[0-5]?\d?)$/", $date, $matches)) {
$ruleName = 'dateTime';
if (strpos($date, '-') !== FALSE) {
$dateVal .= array_shift($matches);
Expand Down

0 comments on commit c7e9b07

Please sign in to comment.