I wonder if there is some type of common method that would help me write query with date/time field in it. For example: I am developing a very small project utilizing MySQL database. However, my client is considering switching to his existing SQL server.
Example (datetime
column):
SELECT DATE_FORMAT(contract_date, '%d.%m.%Y') FROM `employees`
Question: Can query below become usable in SQL in case I replace database driver (currently) mysqli
to sqlsrv
?
I understand I can use some type of config variable for date format... Would it be the best way? Is there something that Codeigniter 3 has in place?
- feel free to use your own query sample