Skip to content
Snippets Groups Projects
Unverified Commit ecd8c938 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #23815 from seamuslee001/date_second_customformat

[REF] Fix second output in customFormat function and extend unit test
parents ef905d58 0bb94e15
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -270,6 +270,7 @@ class CRM_Utils_DateTest extends CiviUnitTestCase {
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%p"), "pm");
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%P"), "PM");
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%Y"), "2018");
$this->assertEquals(CRM_Utils_Date::customFormat($dateTime, "%s"), "44");
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment