Customize and Display Date in YYYYMMDD format

Ever wondered how to customize and display Date from “YYYY-MM-DD” format to “YYYYMMDD” format, Checkout the solution below and let me know if this worked for you..!!
Let me just display the default Date Entries from myaddressbook table below.




Now if you are trying to retrieve birthday details in YYYYDDMM format, execute the below command
SELECT birthday, REPLACE (birthday, '-','') as bday from myaddressbook;





From the above query as you can see Birthday column has the date details displayed in the default format and bday column displays the same date details in the customized format.

Customize and Display Date in YYYYMMDD format Customize and Display Date in YYYYMMDD format Reviewed by Suntaragali The Smart Techie on December 26, 2012 Rating: 5

1 comment: