jkkenzie Posted December 31, 2008 Share Posted December 31, 2008 i would like to convert 2008-12-31 to December 31st, 2008 any idea? Quote Link to comment https://forums.phpfreaks.com/topic/138987-solved-convert-date/ Share on other sites More sharing options...
br3nn4n Posted December 31, 2008 Share Posted December 31, 2008 Yes, just do date(j F Y,"12-31-2008") I'm just going from memory, I don't think those letters are correct. Check the PHP manual about date() for the correct ones. But that's what you need to do. Quote Link to comment https://forums.phpfreaks.com/topic/138987-solved-convert-date/#findComment-726874 Share on other sites More sharing options...
thebadbad Posted December 31, 2008 Share Posted December 31, 2008 Well, almost. You'll need to run strtotime() on the date, and feed that as the second parameter to date(): <?php echo date('F jS, Y', strtotime('2008-12-31')); ?> Quote Link to comment https://forums.phpfreaks.com/topic/138987-solved-convert-date/#findComment-726877 Share on other sites More sharing options...
br3nn4n Posted January 1, 2009 Share Posted January 1, 2009 Ahh yes, knew mine was too easy I always seem to forget small, but important things like that haha. Quote Link to comment https://forums.phpfreaks.com/topic/138987-solved-convert-date/#findComment-727452 Share on other sites More sharing options...
br3nn4n Posted January 1, 2009 Share Posted January 1, 2009 Ahh yes, knew mine was too easy I always seem to forget small, but important things like that haha. Quote Link to comment https://forums.phpfreaks.com/topic/138987-solved-convert-date/#findComment-727454 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.