Display MYSQL date as readable to us humans


/ Published in: MySQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT DATE_FORMAT(dateColumnName, '%m/%d/%Y %h:%i %p') AS whatever
  2.  
  3. ------------------------ RESULT ------------------------
  4.  
  5. //Turns MySQL Date from this
  6. 2009-12-25 16:25:00
  7.  
  8. //TO THIS
  9. Ho Ho Ho, It's Christmas!! (Just kidding)
  10.  
  11. //TO THIS (HONEST)
  12. 25/12/2009 16:25 PM

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.