mdmartiny Posted April 21, 2011 Share Posted April 21, 2011 Hello everyone, I am not sure if I am googling this wrong or what. I have several dates in a mysql database that I would like to display in a dynamically made page. Can someone help me or point me in the right direction. I am very unfamiliar with the MySql date function. I would also like to calculate the days that have passed between two different dates. Example would be: 11-27-2011 and 12-15-2011 = # of days Quote Link to comment https://forums.phpfreaks.com/topic/234312-mysql-date-format-from-yyyy-mm-dd-to-dd-mm-yyyy/ Share on other sites More sharing options...
Pikachu2000 Posted April 21, 2011 Share Posted April 21, 2011 You can use MySQL's DATE_FORMAT() function. SELECT DATE_FORMAT(`field`, '%d-%m-%Y') Quote Link to comment https://forums.phpfreaks.com/topic/234312-mysql-date-format-from-yyyy-mm-dd-to-dd-mm-yyyy/#findComment-1204347 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.