The DATEVALUE() function in Salesforce converts a Date/Time value, or text in YYYY-MM-DD format, into a Date. DATEVALUE(CreatedDate) returns just the day a record was created, in the viewing user’s time zone, so you can compare it with TODAY(), count days, or group records by day.
The time-zone part is where most formulas go wrong, so I tested it in a Salesforce Developer Edition org. Below you’ll see those results, how DATEVALUE differs from DATE, DATETIMEVALUE and TODAY, ready-to-use formulas, and how to use it in a formula field and in Flow.