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? 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. 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 Link to comment https://forums.phpfreaks.com/topic/188117-date-format/#findComment-993170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.