Removed SQL function and added 'substr' to php. Fixes MariaDB.
Note: I did not test against postgres b/c I do not have an install to do so. If the postgres PDO returns dates like 'YYYY-mm-dd HH:MM:SS.....'; then it should be ok for both db's.
Never mind, I see other code where SUBSTRING_FOR_DATE is outside the quotes. I will update to be the same.
postgres is the reason this exists, because of type checking you can't just use substring on a date object there, mysql doesn't care