$dateString = '2022-01-01'; $unixTime = CRM_Utils_Date::unixTime($dateString); echo $unixTime; // Outputs: 1640995200
$timestamp = 1640995200; $unixTime = CRM_Utils_Date::unixTime($timestamp); echo $unixTime; // Outputs: 1640995200This example uses the unixTime function to convert the timestamp 1640995200 (which represents January 1, 2022) to a Unix timestamp. Since it is already a timestamp, the function simply returns the same value. In both examples, the CRM_Utils_Date class is used to call the unixTime function.