$now = date('YmdHis'); $query = "SELECT * FROM civicrm_task WHERE due_date < '$now'"; $results = CRM_Core_DAO::executeQuery($query); while ($results->fetch()) { // display the task }In this example, we use the current date and time as a reference, obtained with the `date` function. We format it as a string in the format `YmdHis` (year, month, day, hour, minute, second), which can be compared with the `due_date` field, assumed to be in the same format. The `CRM_Core_DAO::executeQuery` function executes the SQL query and returns a result object we can iterate over with a `while` loop. Inside the loop, we can access the fields of each task retrieved and display them as needed. Overall, the PHP CRM_Utils_Date library provides useful functions for handling dates and times in a CRM system, such as parsing, formatting, comparing, and calculating durations.