PHP equivalent for MySQL's DATEDIFF
I have a problem with date comparing logic in MySQL and PHP: date difference functions return different results for the same dates. Example: SQL SELECT DATEDIFF('2024-06-02', '2024-05-03 12:57') 30 PHP $x = date_diff( new DateTime( '2024-06-02' ), new DateTime( '2024-05-03…