$dateStr = '2021-12-31 23:59:59'; $isoStr = CRM_Utils_Date::mysqlToIso($dateStr); echo $isoStr; // outputs: 2021-12-31T23:59:59
$dateStr = '2021-12-31 23:59:59'; $localDate = CRM_Utils_Date::mysqlToDateTime($dateStr, TRUE); echo $localDate->format('Y-m-d H:i:s'); // outputs: 2022-01-01 06:59:59This example takes a MySQL-formatted date/time string and converts it to a DateTime object in the local timezone using the mysqlToDateTime function. Based on the function signature and naming conventions, CRM_Utils_Date appears to be part of the CiviCRM package library.