Merge branch '5.51'
[civicrm-core.git] / CRM / Utils / Date.php
index 1bdabb2b60114330378b0ab278a3eb2719e876f4..a08e6b7d680fabd8b150cc59c2f79a29c678e9ee 100644 (file)
@@ -369,7 +369,7 @@ class CRM_Utils_Date {
 
         $hour24 = (int) substr($dateString, 11, 2);
         $minute = (int) substr($dateString, 14, 2);
-        $second = (int) substr($dateString, 16, 2);
+        $second = (int) substr($dateString, 17, 2);
       }
       else {
         $year = (int) substr($dateString, 0, 4);
@@ -433,6 +433,7 @@ class CRM_Utils_Date {
         '%A' => $type,
         '%Y' => $year,
         '%s' => str_pad($second, 2, 0, STR_PAD_LEFT),
+        '%S' => str_pad($second, 2, 0, STR_PAD_LEFT),
       ];
 
       return strtr($format, $date);