Bman900 Posted January 11, 2010 Share Posted January 11, 2010 I was writing a blog system and when I got to the date stamp it comes out as 2010-01-20 and I want it as 01/11/2010. I did directly insert this with phpmyadmin because I did not get to the point where I have a back end for this. But how would I insert this into a query with php? Quote Link to comment https://forums.phpfreaks.com/topic/188117-date-format/ Share on other sites More sharing options...
wildteen88 Posted January 11, 2010 Share Posted January 11, 2010 You can format your dates by first using the strtotime function to convert your date into a unix timestamp. You then pass the timestamp as the second parameter to the date function. This will allow you to change the appearance of your date. Quote Link to comment https://forums.phpfreaks.com/topic/188117-date-format/#findComment-993169 Share on other sites More sharing options...
mikesta707 Posted January 11, 2010 Share Posted January 11, 2010 alternatively, you can use the mysql Date Format function to format the date inside the query itself Quote Link to comment https://forums.phpfreaks.com/topic/188117-date-format/#findComment-993170 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.