Format dates in SQL
Format dates in SQL
Using DATE_FORMAT function ,we can format the date in database.
Example:
SELECT DATE_FORMAT(lastdate,’%a %e %b’) as lastdate FROM user
Using above query, we get ‘MON 08 JAN’ format as result.
The terms %a, %e and %b translate to the abbreviated day of the week , the date of the month , and the abbreviated month respectively.
