I found many developers even sometimes I do some code which could be possible at the database level. Why to format date at coding level when DATE_FORMAT function is available.
Developer should be careful enough to identify the cases where they can performes operation at database level. This will help to improve the overall performance and efficiency of your application.
I will be keep adding the tips about the same in this entry
If you want to format date by fetching it from database, you can use DATE_FORMAT function.
eg. SELECT DATE_FORMAT(now(), ‘%y’) FROM tableName