$today = CRM_Utils_Date::getToday(); echo $today; // Outputs something like '2022-01-22'
$defaultTimezone = date_default_timezone_get(); $date = new DateTime(CRM_Utils_Date::getToday(), new DateTimeZone($defaultTimezone)); echo $date->format('l, F jS, Y'); // Outputs something like 'Saturday, January 22nd, 2022'In this example, the code creates a new `DateTime` object with today's date, taking into account the timezone set in the system. It then formats the output to display the date in a more human-readable format. Overall, the `getToday` function is a simple and useful utility function in the CiviCRM package library that can be used in a variety of scenarios where the current date is needed.