Matt Ridge Posted November 9, 2011 Share Posted November 9, 2011 I have a database that produces a date as year/month/day I want it to be more "Americanized" which is month/day/year as its output, is that possible? Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/ Share on other sites More sharing options...
Pikachu2000 Posted November 9, 2011 Share Posted November 9, 2011 Details? Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286715 Share on other sites More sharing options...
Matt Ridge Posted November 9, 2011 Author Share Posted November 9, 2011 Details? It's a simple as that, the database I designed is putting dates in as Y-m-d, I am asking is there a way to change it pre or post SQL to m-d-Y? Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286720 Share on other sites More sharing options...
Pikachu2000 Posted November 9, 2011 Share Posted November 9, 2011 Yes. Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286727 Share on other sites More sharing options...
markjoe Posted November 9, 2011 Share Posted November 9, 2011 (Pikachu2000 - the Help Vampire slayer, lol) Matt Ridge, check out: date_parse_from_format() mktime() date() and such. An learning to ask better questions will help too. http://slash7.com/2006/12/22/vampires/ Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286740 Share on other sites More sharing options...
AyKay47 Posted November 9, 2011 Share Posted November 9, 2011 there are really two routes that you can take for this.. you can take the MYSQL route and use mysql functions for this, or you can go the PHP route and use PHP's built in date-time functions for this.. either of these you can google for Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286741 Share on other sites More sharing options...
Pikachu2000 Posted November 9, 2011 Share Posted November 9, 2011 The answer can only be as specific as the information provided. The OP didn't even see fit to mention what RDBMS is being used, and didn't bother to provide so much as a query string or a table description. Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286744 Share on other sites More sharing options...
AyKay47 Posted November 9, 2011 Share Posted November 9, 2011 (Pikachu2000 - the Help Vampire slayer, lol) Matt Ridge, check out: date_parse_from_format() mktime() date() and such. An learning to ask better questions will help too. http://slash7.com/2006/12/22/vampires/ in most cases, the quality of the answer reflects the quality of the question.. Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286747 Share on other sites More sharing options...
markjoe Posted November 9, 2011 Share Posted November 9, 2011 in most cases, the quality of the answer reflects the quality of the question. quite right, which is why I recommend the OP learn how to ask better questions. Assuming that "Yes" isn't the answer he wanted, even though it was a legit and accurate answer to the question he asked. Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286758 Share on other sites More sharing options...
Matt Ridge Posted November 9, 2011 Author Share Posted November 9, 2011 in most cases, the quality of the answer reflects the quality of the question. quite right, which is why I recommend the OP learn how to ask better questions. Assuming that "Yes" isn't the answer he wanted, even though it was a legit and accurate answer to the question he asked. Actually it was the answer I needed. I was asking in a generic sense... I didn't feel the need to go into a tirade like I normally do. I'm on a time crunch. Quote Link to comment https://forums.phpfreaks.com/topic/250790-changing-date-format/#findComment-1286768 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.