Move sql-date function to utils